Search code examples
delphilock-freelazarus

Is this Algorithm for lock-free fifo queue management any good?


I just found this:

http://www.emadar.com/fpc/lockfree.htm

at first glance it looks fine. Is anybody using it? Or maybe somebody already looked at it and found it unusable?


Solution

  • If it is ok, it is only ok for x86 and x86_64 processors, and most likely not for PowerPC (and maybe ARM), since there are no memory barrier instructions.

    I've it in production for a simple case, and noticed no problems. I use the non-generic one in Delphi though.