Re: [LAD] Atomic Operations

From: Tim Blechmann <tim@email-addr-hidden>
Date: Tue Dec 15 2009 - 18:36:40 EET

> 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@email-addr-hidden
http://tim.klingt.org
art is short - life is long
  Jack Kerouac

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev

Received on Tue Dec 15 20:15:05 2009

This archive was generated by hypermail 2.1.8 : Tue Dec 15 2009 - 20:15:06 EET