Spinlock versus Semaphore

后端 未结 11 680
广开言路
广开言路 2020-11-28 17:19

What are the basic differences between a semaphore & spin-lock?

When would we use a semaphore over a spin-lock?

11条回答
  •  自闭症患者
    2020-11-28 17:59

    From Linux Device Drivers by Rubinni

    Unlike semaphores, spinlocks may be used in code that cannot sleep, such as interrupt handlers

提交回复
热议问题