views:

136

answers:

2

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

I'm looking for implementations of lock-free containers:

  • Queue
  • Stack
  • Hash Map
  • etc...

How about blocking containers:

  • Blocking Queue
  • Blocking Stack

Are there any good libraries out there? I would like to refrain from writing these data structures... I would much rather use something that has been tested by the community.

+4  A: 

Have a look at the container classes of Intel TBB. The reference says:

The container classes permit multiple threads to simultaneously invoke certain methods on the same container.

Polybos
+2  A: 

Herb Sutter did a few articles in his Effective Concurrency series in Dr. Dobbs Journal. The two articles you'll probably want to read right away are:

The rest of the series is definitely worth a read as well.

greyfade
@greyfade, thanks... I'm aware that there are articles describing how to write these containers, but I would prefer to use a tried and tested library rather than write the containers myself.
Lirik
@Lirik: The main reason I link to them is because Herb does a *very* deep discussion on how and why it works, and what pitfalls there are in writing it. He also has complete, working examples which I've copied and used verbatim with success. (Although they expect a C++0x-compatible compiler or an equivalent `atomic<>` type.)
greyfade