Jump to content
  • Advertisement
Sign in to follow this  

Help finding Lock-Free Ring Buffer / FIFO queue

This topic is 4029 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!