Sign in to follow this  

Help finding Lock-Free Ring Buffer / FIFO queue

This topic is 3815 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, So i'm playing around with a bizarro multi-processor architecture. Does anyone know where I can find source to either a lock-free ring-buffer or just plain ol lock-free FIFO queue? Since this will get hit frequently, I'd prefer something that doesn't require memory allocation/deallocation for the enqueue/dequeue operations (though that's perhaps a separate issue). [EDIT: should mention I'm working in C++ primarily on windows] [EDIT2: more detail. I'm looking for only single-writer (and preferably multiple-reader) implementations. single-reader could still work if it's easier to find code] To prove my due diligence [smile]: I've found a uniprocessor version of the former and a few papers describing the latter. I could certainly derive the code from the papers but I'd feel safer finding a "known good" implementation of either. This is something I'd rather not (1) reinvent and (2) debug for what I hope are obvious reasons. =) The links I've found: uniprocessor single-reader/single-writer FIFO ring buffer (not useful to me): http://www.talkaboutprogramming.com/group/comp.programming.threads/messages/40308.html a lock-free ring buffer that does not appear to be thread-safe: http://www.koders.com/cpp/fid1046F7A7424EEC26F13612E1DCECBF4656052B85.aspx a paper describing a lock-free FIFO queue: http://people.csail.mit.edu/edya/publications/OptimisticFIFOQueue-DISC2004.pdf some more papers on algorithms: http://www.cs.chalmers.se/~yzhang/thesis.pdf Now, the last two are certainly helpful, but don't contain full source code. Also, for optimization reasons I'd prefer it be a ring buffer since I don't want there to be constant allocations in this part of my design. -me [Edited by - Palidine on July 8, 2007 7:12:35 PM]

Share this post


Link to post
Share on other sites

This topic is 3815 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this