3 ms·
I have no strong opinion on this as long as you are not using queues for purposes of inter-thread communication. If you are using queues for this purpose, then
by bob1029 4y ago
I have no strong opinion on this as long as you are not using queues for purposes of inter-thread communication.
If you are using queues for this purpose, then I recommend reading the following:
https://lmax-exchange.github.io/disruptor/disruptor.html#_the_problems_of_queues https://lmax-exchange.github.io/disruptor/disruptor.html#_th...
> When in use, queues are typically always close to full or close to empty due to the differences in pace between consumers and producers. They very rarely operate in a balanced middle ground where the rate of production and consumption is evenly matched.
This has always been my experience. Has anyone ever had a perfect goldilocks scenario between 2 threads?
- wongarsu 4y agoOne good use-case for still using queues is if your producer or consumer has spiky characteristics on small timescales, but predicatable perfomance if you zoom out enough. In that case your queue size spikes to some high value, but always returns to 0. The reasons for this can be numerous, maybe you produce a lot of jobs at once because of a user interaction, or your consumer is running slower for five minutes because some cron job is stealing your resources.