java-concurrency icon indicating copy to clipboard operation
java-concurrency copied to clipboard

Clarify JCTools advice

Open nitsanw opened this issue 4 years ago • 1 comments

Thanks for these note! very interesting and useful I note that the advice to use JCTools: https://github.com/code-review-checklists/java-concurrency#jctools

Was it considered to use one of the array-based queues from the JCTools library instead of ArrayBlockingQueue? Those queues from JCTools are classified as blocking, but they avoid lock acquisition in many cases and are generally much faster than ArrayBlockingQueue.

There's a nuance here that may be lost on readers in that the queues in JCTools are sometimes blocking (in the concurrency sense), but also lock-less and can allow better progress guarantees. I'm not sure this document is the place to make such fine grained explanations though, so feel free to leave as is. I would also argue that people who use ConcurrentLinkedQueue or LinkedBlockingQueue should consider the alternatives from JCTools. In any case, thanks for the mention :-)

nitsanw avatar Mar 11 '20 07:03 nitsanw

I can give you write access to the repo so that you can adjust the language of JCTools item and add a new item ConcurrentLinkedQueue/LinkedBlockingQueue (or extend a JCTools item). Or you could make a PR.

leventov avatar Mar 11 '20 10:03 leventov