3 ms·
This doesn't look like I remember, but this sounds right. https://lmax-exchange.github.io/disruptor/disruptor.html#_design_of_the_lmax_disruptor https://lmax-e
by sgtnoodle 4y ago
This doesn't look like I remember, but this sounds right.
https://lmax-exchange.github.io/disruptor/disruptor.html#_design_of_the_lmax_disruptor https://lmax-exchange.github.io/disruptor/disruptor.html#_de...
The basic idea is that you maintain two atomically incremented counters. You increment one to allocate some buffer space to write your message into, and you increment the other once the message is written in. There's some tricky details to get right when multiple producers have messages staged up at the same time.
- bmitc 4y agoThank you!