5.7.4. Concurrency and Race Conditions
Terms- Concurrency (dt.: Nebenläufigkeit): two or more threads run at the same time and interact
- race condition (dt.: Wettlaufsituation): inconsistent results due to uncontrolled access to shared data
- deadlock (dt.: Blockierung): two or more processes are indefinetly waiting for each other to free access to a resource
- critical path (dt.: kritischer Weg): codesegment which accesses a shared resource
- mutual exclusion (dt. wechselseitiger Ausschluss): techniques used to protect critical paths against race conditions
- in old non-preemptive kernels (before 2.5):
- interrupts
- 2.5 and newer:
- kernel preemption
- SMP (other CPU)
- interrupts
- delayed code execution (workqueues, tasklets, timers)
- lock-free possible?
- ordering: always obtain multiple locks in the same order (avoids deadlocks)
- start with coarse locking and refine
- document which functions need to be called with which locks held
5.7.3. The ioctl system call | 1. Denx Training Topics | 5.7.4.1. Atomic operations | |||
Prev | Home | Next | |||