RFR: 8301341: LinkedTransferQueue does not respect timeout for poll() [v8]

Viktor Klang duke at openjdk.org
Fri Jul 21 09:42:42 UTC 2023


On Thu, 20 Jul 2023 10:26:03 GMT, Doug Lea <dl at openjdk.org> wrote:

>> This update addresses performance issues across both LinkedTransferQueue and SynchronousQueue by creating a common basis for implementation across them (mainly in LinkedTransferQueue).  Pasting from internal doc summary of changes:
>>      * * Class DualNode replaces Qnode, with fields and methods
>>      *   that apply to any match-based dual data structure, and now
>>      *   usable in other j.u.c classes. in particular, SynchronousQueue.
>>      * * Blocking control (in class DualNode) accommodates
>>      *   VirtualThreads and (perhaps virtualized) uniprocessors.
>>      * * All fields of this class (LinkedTransferQueue) are
>>      *   default-initializable (to null), allowing further extension
>>      *   (in particular, SynchronousQueue.Transferer)
>>      * * Head and tail fields are lazily initialized rather than set
>>      *   to a dummy node, while also reducing retries under heavy
>>      *   contention and misorderings, and relaxing some accesses,
>>      *   requiring accommodation in many places (as well as
>>      *   adjustments in WhiteBox tests).
>
> Doug Lea has updated the pull request incrementally with one additional commit since the last revision:
> 
>   nitpicks

src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java line 612:

> 610:         else if (m != null)
> 611:             s.selfLinkItem();
> 612:         return m;

@DougLea I'd probably add a newline before the return statement to visually distinguish that it isn't intended to be read as a part of the if-else branches.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14317#discussion_r1270476396


More information about the core-libs-dev mailing list