On Mon, 18 May 2026 14:38:55 GMT, Andy Goryachev <[email protected]> wrote:

> It feels like my concerns about synchronization were not properly addressed.

I did step through the effect peer creation path, and didn't see anything 
suspicious. However, I want to point out that this code was always called while 
holding a lock: in the old version, it was using the `this` monitor, in the new 
version it's using a more narrowly-scoped monitor that isn't accessible to 
outside code.

In any case, I'll create a ticket to look at removing the lock entirely, as I 
think it's probably not needed because rendering is single-threaded.

> Also, the use of mutable key (which might be ok in this particular case, hope 
> there is no chance for re-entry), but this design is - let's say - 
> unorthodox, might have created a booby trap.

Yes, it's not something you'd usually do, but in this specific case it saves us 
from lots of allocations on a hot path. Performance optimization is always a 
trade-off, but I think the risk of misuse is quite small here (it's localized 
and not reusable outside of the class).

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

PR Comment: https://git.openjdk.org/jfx/pull/2091#issuecomment-4479284396

Reply via email to