Hacker News new | ask | show | jobs
by Uchikoma 5133 days ago
Take a look at the ring buffer data structure from the LMAX architecture (my talk on LMAX http://codemonkeyism.com/lmax-architecture-high-performance-... or http://martinfowler.com/articles/lmax.html from Martin Fowler).

They have incoming work, I/O for incoming and outgoing work is done multi threaded while work on events is single threaded.

The architecture is quite clever as more than one event processor can work on the data structure and event processors can have dependencies on each other. Independent processors can race past each other.

It was written for trading and might be portable to C++, but if you consider switching to JS it might also be ok for you to switch to Java. Their framework is called Disruptor and open source

http://code.google.com/p/disruptor/

"LMAX aims to be the fastest trading platform in the world. Clearly, in order to achieve this we needed to do something special to achieve very low-latency and high-throughput with our Java platform. Performance testing showed that using queues to pass data between stages of the system was introducing latency, so we focused on optimising this area."