[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: RFR: 8320707: Virtual thread test updates
From:       Alan Bateman <alanb () openjdk ! org>
Date:       2023-12-19 9:18:39
Message-ID: -J_DKfk6g-qoYrPZcs-mdUUAG_wnsMzle2aZQhdXps4=.53d1ae20-503b-4b01-94c8-a10421e5405d () github ! com
[Download RAW message or body]

On Mon, 18 Dec 2023 20:37:29 GMT, Chris Plummer <cjplummer@openjdk.org> wrote:

> I'm working on a test where I just added a CountDownLatch(1) and am wondering if I \
> should do the same, but I'm not sure if there is something about these tests that \
> is motivating the change.

CountDownLatch is great for many tests. It's not as powerful as a Phaser of course \
but good enough and usually easy to understand quickly what is going on. However, for \
tests that are testing thread state then you often want to have as few dependencies \
as possible. In the case of CountDownlatch, the await method may park. The countDown \
method may have to unpark waiters for for virtual threads it means potentially \
parking (to queue a task) when unparking, so temporary transitions that JVMTI has to \
be concerned with. The other thing is keeping tests simple/consistent, it can be hard \
to maintain tests where one test method coordinates with one approach, another test \
method does something different.

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

PR Comment: https://git.openjdk.org/jdk/pull/17136#issuecomment-1862390382


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic