- Recursive spinlock - 3 Updates
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: May 09 02:57PM -0700 On 5/9/2020 12:49 AM, Bonita Montero wrote: > the scheduler in userland. The problem here is that a thread holding > a spinlock might get de-scheduled and other treads will spin and con- > sume CPU-time unutil it gets re-scheduled to relinquish the ownership. Mostly true. However, an adaptive lock, that spins a couple of times before it actually blocks can be useful in userland. The PAUSE instruction can help out here. |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: May 09 11:11PM +0100 On 09/05/2020 22:57, Chris M. Thomasson wrote: >> a spinlock might get de-scheduled and other treads will spin and con- >> sume CPU-time unutil it gets re-scheduled to relinquish the ownership. > Mostly true. However, an adaptive lock, that spins a couple of times before it actually blocks can be useful in userland. The PAUSE instruction can help out here. Which is what my recursive spinlock does; Bonita should try looking at the fucking code before commenting. /Flibble -- "Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: May 09 04:22PM -0700 On 5/9/2020 3:11 PM, Mr Flibble wrote: >> instruction can help out here. > Which is what my recursive spinlock does; Bonita should try looking at > the fucking code before commenting. Indeed. Fwiw, there are clever distributed adaptive locks, however I am not sure if they would be the right fit in your system. There are some fun ones, I remember a while back about an algorihtm called MLock. I cannot find the posts right now over on comp.arch, however they can be useful. |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment