3 ms·
> It looks like these are more lower level libraries so clients are supposed to block, but they are responsible for doing the blocking themselves. You busy spi
by joas_coder 2y ago
> It looks like these are more lower level libraries so clients are supposed to block, but they are responsible for doing the blocking themselves.
You busy spin when blocking (fastest) or you can use a WaitStrategy from https://www.github.com/coralblocks/CoralQueue https://www.github.com/coralblocks/CoralQueue. You can see an example here: https://github.com/coralblocks/CoralQueue/blob/main/src/main/java/com/coralblocks/coralqueue/example/waitstrategy/Minimal.java https://github.com/coralblocks/CoralQueue/blob/main/src/main...
> And given these are designed for "ultra-low-latency" systems, I don't think that's a big problem because the best blocking strategy is probably just to spin.
If you have an isolated and dedicated CPU core for your thread, that's correct. Busy-spinning is the fastest/best strategy.
> It would be nice if the docs were nicer though, considering this is a paid product...
CoralRing and CoralQueue are open-source and free at GitHub. There are also a lot of documentation and explanations on the GitHub README.me page (front page). The code has also a lot of comments.
- nulld3v 2y agoOof, I saw "CoralQueue" on the product list on your website and I just immediately assumed it was a paid product. But I didn't even think of looking at the LICENSE files, my bad! Regarding the docs, I was only looking at CoralRing, and it looks like CoralQueue has some additional documentation that applies to CoralRing as well. After reading through them everything makes a lot more sense.