nicholassm / disruptor-rs

Low latency inter-thread communication library in Rust inspired by the LMAX Disruptor.
MIT License
618 stars 18 forks source link

Can BlockingWaitStrategy and SleepingWaitStrategy be integrated? #1

Closed ulnit closed 1 year ago

ulnit commented 1 year ago

When there is no data inflow, the busyspin wait strategy consumes all the CPU.

nicholassm commented 1 year ago

They definitely can. However, if you want to conserve CPU resources, why not use the excellent crossbeam library instead?

Currently, it would be easiest to integrate the SleepingWaitStrategy. The BlockingWaitStrategy requires a bit more rework of the internals. I'll add the SleepingWaitStrategy to the roadmap.

Kind regards Nicholas

ulnit commented 1 year ago

They definitely can. However, if you want to conserve CPU resources, why not use the excellent crossbeam library instead?

Currently, it would be easiest to integrate the SleepingWaitStrategy. The BlockingWaitStrategy requires a bit more rework of the internals. I'll add the SleepingWaitStrategy to the roadmap.

Kind regards Nicholas

Sure, thank you . I will try using the crossbeam library first.