On Sat, 16 May 2026 11:41:51 GMT, Marius Hanl <[email protected]> wrote:

> > The EffectPeer instances were disposed, but not removed from the map
> 
> Yes, that is what I mean. But is there any side effect we may have now that 
> we remove those entries from the map?

No, I don't think so.

> If I understand you right, synchronization is the reason you chose to not do?:
> 
> ```
>  for (EffectPeer<?> peer : peerCache.values()) {
>     peer.dispose();
> }
> peerCache.clear();
> ```
> 
> Because this would save us the temp array and is a bit easier too.

The temporary array is nothing to worry about, this doesn't happen repeatedly 
on a hot path. The reason I'm doing it like this is to be able to call the 
dispose method without holding a lock, so as to not introduce any risk of 
deadlocks. Removing synchronization entirely seems reasonable, but is out of 
scope for this PR.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2091#discussion_r3252768043

Reply via email to