When a process in the kernel space is holding a spin_lock
, the process cannot be preempted due to any of the following conditions :
- When the time-slice of the process gets exhausted
- When a high priority process becomes runnable
- When an interrupt occurs
However the process can yield the processor if it blocks, sleeps, or explicitly call schedule()
. Is my understanding correct?
When a process in the kernel space is holding a mutex_lock
, can the process be preempted due to the above conditions listed as 1, 2 and 3.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…