1

Which of the existing collections of data in C/C++ is the most suitable close in functionality to collection(library) Disruptor in Java?

http://lmax-exchange.github.io/disruptor/

The small description:

It is an extremely fast alternative using messaging queues in multithreaded programs. Framework which has "mechanical sympathy" for the hardware it's running on, and that's lock-free. And lots of efforts to avoid lock, CAS, even memory barrier.

Read more about it in the discussion: How does LMAX's disruptor pattern work?

Community
  • 1
  • 1
Alex
  • 12,578
  • 15
  • 99
  • 195
  • 2
    I don't know what the disruptor pattern is. But this seems to be a valid question. – Martijn Courteaux Nov 12 '13 at 21:36
  • 1
    Agreed, especially since the poster included a link to a project based on the Disruptor pattern, although this: http://lmax-exchange.github.io/disruptor/ is a better link. – Dale Wilson Nov 12 '13 at 21:37
  • 2
    Regardless of the link used it would be beneficial to include some details about what you are trying to accomplish. It would also be beneficial to include a short description of the pattern instead of relying solely on an external resource that may disappear in the future. – Captain Obvlious Nov 12 '13 at 21:41
  • @Captain Obvlious Ok, I added the small description. – Alex Nov 12 '13 at 21:59

2 Answers2

2

If you want the same functionality, use a mutex protected queue. If you want the same performance you should re-implement the disruptor algorithm in C++ or try this open source project: https://code.google.com/p/disruptor-cpp/

And for those who don't know, the Disruptor (unfortunate name) is a message passing technique that uses lock-free algorithms and pays close attention to issues such as cache conflicts, to deliver very high performance in cases where it can be used. A company named LMAX came up with it and named it. Martin Fowler (of Refactoring fame) is an advocate for it.

Dale Wilson
  • 9,166
  • 3
  • 34
  • 52
1

Yes, there is already a functional C++ port. See https://github.com/fsaintjacques/disruptor--

constantlearner
  • 5,157
  • 7
  • 42
  • 64