Comments (2)
You should profile the CPU usage just to be sure where the time is being taken.
Having said that I suspect that if your first consumer is much slower than your second consumer the second blocking wait strategy will be spinning in this loop waiting for a dependent sequence: https://github.com/LMAX-Exchange/disruptor/blob/master/src/main/java/com/lmax/disruptor/BlockingWaitStrategy.java#L45
In the .NET port there is an implementation that will not use 100% CPU as it will actually sleep the thread occasionally instead of just yielding.
from disruptor.
You should profile the CPU usage just to be sure where the time is being taken.
Having said that I suspect that if your first consumer is much slower than your second consumer the second blocking wait strategy will be spinning in this loop waiting for a dependent sequence: https://github.com/LMAX-Exchange/disruptor/blob/master/src/main/java/com/lmax/disruptor/BlockingWaitStrategy.java#L45
In the .NET port there is an implementation that will not use 100% CPU as it will actually sleep the thread occasionally instead of just yielding.
Thank you for your reply.Maybe I didn't describe it clearly.My business scenario is a simple asynchronous alarm,Each consumer only delivers messages to MQ.There should be no chance of any one being blocked.Let me refer to the implementation.Finally thank you anyway
from disruptor.
Related Issues (20)
- pictures in doc files are broken HOT 2
- [Question] How to test batch behavior? HOT 5
- remove redundant judgment
- `EventHandler::setSequenceCallback` will not play well with `RewindableException` throwing event handlers
- Add a maximum batch size to the `BatchEventProcessor`
- lmax library compatibility with Java 11 and Java 17 HOT 1
- `Util.log2` gets stuck in endless loop for negative values
- 4.0 is based on JDK11. Will the JDK8-based 3.x version continue to be released? HOT 1
- Can a new 3.X version be released based on 3.4.4? HOT 3
- 4.0.0.RC1 has been released for more than one year. When will another stable version be released?
- please guide me,thanks. HOT 1
- A service creates multiple Disruptors HOT 4
- Unable to set disruptor as singleton HOT 2
- Directly replace Fence with the methods setRelease, setVolatile, and getAcquire. No need to set barriers via VarHandle HOT 1
- FixedSequenceGroup What does this class do? HOT 1
- SequenceBarrier.waitForSequence sometimes doesn't respect BlockingWaitStrategy
- Lmax Disruptor Version 4.0.0 with MultiProducers blocks in ringbuffer.next() call HOT 1
- Problem Using LMAX Disruptor 4.0.0 with JDBC-postgres 42.6.0 HOT 4
- Java 21 and log4j HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from disruptor.