|
![](/i/fill.gif) |
Le 10/08/2012 01:48, Darren New a écrit :
> On 8/7/2012 5:42, Le_Forgeron wrote:
>> The difficult part in all such algorithms is the "special" write
>> instruction. You cannot make it lock-free without the support at the
>> assembly level by the instruction set (at least in NUMA architecture)
>
> Not true. Look up Lamport's bakery algorithm. (Wikipedia has a good
> write-up.)
>
The backery is lock free, but need either static threads or a global
registry (list, whatever) of all active threads. You cannot protect such
registry with backery (deadly recursion).
(
Other inherent issue is unlimited number: on rollover with an actual
implementation, you're stuck.
Post a reply to this message
|
![](/i/fill.gif) |