Greg Stein <[EMAIL PROTECTED]> writes:

> I once tried to created a lock-less linked-list for managing some thread
> state stuff in Python. I believe that it finally came to a point where I had
> a simple proof that you just can't implement a read/write linked list in a
> multi-threaded environemnt without a lock. Beats me if I can remember the
> key point, though.

As long as reasonable restrictions are placed on allowable list
operations (restrictions which are not a problem when the list is used
to maintain a free pool) you can implement a lock-free linked list.
Been there, done that.  On S/390 we commonly use a double-word
compare-and-swap operation.  Other platforms have this as well.
Different instructions are available on still more platforms.

-- 
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Reply via email to