RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v12]
Dean Long
dlong at openjdk.org
Mon Oct 28 23:49:25 UTC 2024
On Mon, 28 Oct 2024 18:58:29 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:
> regardless of when you freeze, while doing the freezing the monitor could have been released already. So trying to acquire the monitor after freezing can always succeed, which means we don't want to unmount but continue execution, i.e cancel the preemption.
Is this purely a performance optimization, or is there a correctness issue if we don't notice the monitor was released and cancel the preemption? It seems like the monitor can be released at any time, so what makes freeze special that we need to check afterwards? We aren't doing the monitor check atomically, so the monitor could get released right after we check it. So I'm guessing we choose to check after freeze because freeze has non-trivial overhead.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/21565#issuecomment-2442880740
More information about the nio-dev
mailing list