Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for December 5, 2013
Deadline scheduling: coming soon?
LWN.net Weekly Edition for November 27, 2013
ACPI for ARM?
LWN.net Weekly Edition for November 21, 2013
Adaptive spinning futexes
Posted May 13, 2010 11:38 UTC (Thu) by farnz (guest, #17727)
That gets into implementation dependent knowledge - on some implementations of hyperthreading, if one thread is just reading a memory location, testing the value, and looping, almost all the execution units will be spare for the other hyperthread. If that thread releases the lock quickly, the thread that has been spinning is instantly ready to work, and you get maximum benefits from hyperthreading.
Posted May 13, 2010 14:13 UTC (Thu) by ejr (subscriber, #51652)
A problem with adaptive spinlocks occurs when you spin on something bounced between memory / caches / processors. By the time you swap out, you've eaten a large cost and blown a lot of memory traffic. I suspect the kernel's in a better position to know what's where with less cache overhead than user-space adaptive spinlocks, so this is sounding potentially great.
Posted May 17, 2010 17:06 UTC (Mon) by dvhart (guest, #19636)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds