Posted Aug 6, 2009 9:28 UTC (Thu) by eliezert (subscriber, #35757)
[Link]
I would call the busywait spinlocks.
This is what they do, and this will also make it obvious they should be used rarely.
I like your cooked / raw proposal, but I think a name the would discourage unnecessary use would be better.
The obvious name ...
Posted Aug 6, 2009 18:03 UTC (Thu) by cpeterso (guest, #305)
[Link]
busywait_spinlock is a great name! It accurately describes its behavior and discourages people from using it (without deep thought).
The obvious name ...
Posted Aug 10, 2009 14:44 UTC (Mon) by kjp (subscriber, #39639)
[Link]
I thought atomic_spinlock wasn't too bad, but I like busywait_spinlock.
Of course, I do think it would be better to rename the spinlock itself if it no longer does that....
I guess to facilitate the changeover you could have atomic_lock or busywait_lock (spin is a bit redundant) and mutex, and only very old code would need a typdef for the now non existant 'spinlock' type.
The obvious name ...
Posted Aug 7, 2009 0:40 UTC (Fri) by Kamilion (subscriber, #42576)
[Link]
Eh, I signed up just to post up "snooze_lock".
Seemed pretty self-explanatory to me. :)
And there's always the alarm-clock connotation, someone always manages to mash the snooze button.
The obvious name ...
Posted Aug 7, 2009 1:08 UTC (Fri) by martinfick (subscriber, #4455)
[Link]
But, it's not a snooze lock, it's a spin lock! A snooze lock would imply that a process goes to sleep and yields the processor. A spin lock does not yield, it's in fact the opposite of a "sleep" lock.
If I understand the naming dilemma, the problem is that the old spin_locks which will not be renamed are in fact becoming sleep locks. If your naming convention is adopted, you would have spin_locks which sleep, and snooze_locks which spin!
So, raw_spinlock or real_spinlock seem more appropriate to me.
The obvious name ...
Posted Aug 10, 2009 18:08 UTC (Mon) by kjp (subscriber, #39639)
[Link]
It's incredibly sad if the spinlocks wouldn't get renamed. Linux already has incredibly badly named things (struct class anyone?) but now it's also getting incapable of making a mass rename due to what - proprietary or out of tree code?