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?

4

2 回答 2

2

如果您想要相同的功能,请使用互斥体保护队列。如果您想要相同的性能,您应该在 C++ 中重新实现中断算法或尝试这个开源项目:https ://code.google.com/p/disruptor-cpp/

而对于那些不知道的人来说,Disruptor(不幸的名字)是一种消息传递技术,它使用无锁算法并密切关注缓存冲突等问题,在可以使用的情况下提供非常高的性能。一家名为 LMAX 的公司想出了它并命名它。Martin Fowler(以重构闻名)是它的倡导者。

于 2013-11-12T21:35:50.783 回答
1

是的,已经有一个功能性的 C++ 端口。见https://github.com/fsaintjacques/disruptor--

于 2013-11-12T21:42:54.060 回答