[LAD] Atomic Operations

Tim Blechmann tim at klingt.org
Tue Dec 15 16:36:40 UTC 2009


> For one of my projects I once ported the kfifo implementation in the
> Linux kernel to a C++ class.  Feel free to use it if you'd find it
> useful.  (GPL)
> 
> http://github.com/radarsat1/dimple/blob/master/src/CircBuffer.h

you should add memory barriers, when reading or writing to the reader or
writer indices ... my implementation (without size limitation to a power
of two) can be found at [1]

hth, tim

[1]
http://tim.klingt.org/git?p=boost_lockfree.git;a=blob;f=boost/lockfree/ringbuffer.hpp;h=139f79869f610c61b0d117d2836a3c8c4949db02;hb=03d4e397a74f2b85c87f6b54b4755428956ff63a

-- 
tim at klingt.org
http://tim.klingt.org

art is short - life is long
  Jack Kerouac

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20091215/ac011962/attachment.pgp>


More information about the Linux-audio-dev mailing list