且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

自旋锁和信号灯之间的区别

更新时间:2023-02-26 18:12:51

自旋锁使过程不断循环直到自旋锁被释放,而信号量则导致自旋锁进入睡眠直到释放的过程.

如果您要等待更长的时间才能满足条件,通常***使用信号灯.
A spinlock causes the process to continuously loop until the spinlock is released, while a semaphore causes the process to sleep until it''s released.

A semaphore is usually better if you''re going to be waiting a longer time for the criteria to be met.


请购买一本书,而不是在此处发布所有家庭作业问题
Please buy a book instead of posting all of your homework questions here