One use for reference-count biases...
Posted Jun 9, 2009 13:50 UTC (Tue) by
PaulMcKenney (subscriber, #9624)
In reply to:
One use for reference-count biases... by neilbrown
Parent article:
Linux kernel design patterns - part 1
Hmmmm... I was thinking more in terms of something like the following:
preempt_disable();
if (per_cpu_counter > 0)
per_cpu_counter++;
else
do some costly global-lock-and-variable thing
preempt_enable();
But it has been a good ten years since I messed with this, so I should take another look at it.
In any case, I very much agree with your overall premise that higher-level primitives are a very great improvement over continually re-inventing the wheel, most especially for those wheels with a strong history of being re-invented badly!!!
(
Log in to post comments)