質問

I read and studied how spinlocks work. Now I have a question which I can't find an exhaustive answer to:

how do they work in a UP (uni-processor) environment and in a SMP (symmetric multi processor) environment? What are the differences and problems?

役に立ちましたか?

解決

Spinlocks are essentially useless in UP case. They will just burn their time slice. They would better sleep in UP. In case of SMP spinlocks may be preferred over sleeping, if expected wait time is lower than average time that is needed to get time slice again for this thread.

Answering your question "how do they work"? Exactly the same everywhere, just spending CPU time in their time slice.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top