Hi David, Part of the missing picture here is how AppContexts get created and > dispose()'d as it may be that the way AppContext is used you can't actually > get concurrent modification of numAppContexts. But there's no way to discern > that from the AppContext code so it would be safer to use the AtomicInteger. >
I had a look how AppContexts are created, and at least the IcedTea plugin calls SunToolkit.createNewAppContext() in a fresh thread without any synchronization (as does caciocavallo-web). I don't this with all the code the non-atomicity of operations on numAppContexts is a real-world problem, but on the other hand - it wouldn't hurt to have this replaced with correct code ;) - Clemens
