Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a concurrent container library for C++ [duplicate]

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.

like image 530
Kiril Avatar asked May 15 '10 17:05

Kiril


2 Answers

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.

like image 156
Karl von Moor Avatar answered Sep 19 '22 09:09

Karl von Moor


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:

  • Writing Lock-Free Code: A Corrected Queue
  • Writing a Generalized Concurrent Queue

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

like image 38
greyfade Avatar answered Sep 22 '22 09:09

greyfade