8

Possible Duplicate:
Is there a production ready lock-free queue or hash implementation in C++

I am looking for a well-tested, publicly available C/C++ implementation of a lock free queue.

I need at least multiple-producers/single-consumer functionality. Multiple-consumers is even better, if exists.

I'm targetting VC's _Interlocked... intrinsics, though anything which is straight forward to port would be fine.

Could anyone give any pointers?

Community
  • 1
  • 1
uj2
  • 1,391
  • 2
  • 15
  • 15
  • The TBB library has some lock-free containers (although I can't remember whether it comes with a queue): http://www.threadingbuildingblocks.org/ – sbi Apr 27 '10 at 09:13
  • TBB has a concurrent_queue, though the docs only state that it's thread safe without mentioning lock-freeness. Anyway, TBB's license is problematic (GPL/Commercial). – uj2 Apr 27 '10 at 11:43
  • 3
    Take a look at http://stackoverflow.com/questions/1164023/is-there-a-production-ready-lock-free-queue-or-hash-implementation-in-c – actual Apr 27 '10 at 14:01
  • Qt allows this, last time I checked. It comes with a whole whack of other stuff though (practically a whole language extension by the time QMake is done). – Nicholas Wilson Apr 27 '10 at 18:16

1 Answers1

0

If you're ok to go down that route, there's always the Windows thread pool.

Puppy
  • 144,682
  • 38
  • 256
  • 465