On Wed, 25 Jan 2023 12:26:26 GMT, Per Minborg <pminb...@openjdk.org> wrote:
> This PR proposed to reduce contention in synchronized methods mainly by doing > I/O operations outside synch blocks. Let me take a step back here and explain the reason why I think this PR is worth looking at. Firstly, I think the argument that this might not solve https://bugs.openjdk.org/browse/JDK-8300917 is perfectly valid. Therefore, I have filed a separate issue and linked this PR to this. Thanks for pointing this out. This PR is more like a drive-by cleanup as mentioned. Back to the contents of the PR. My fear (which may or may not be substantiated) is that if we perform operations via the relatively slow `System.err.printf,` while being in a synchronization block, we are exposed to a number of potential problems: * Another thread might be performing `System.err` operations which will be under a separate lock/sync * Other threads are calling `ensureNativeAccess` for the same module * A "storm of calls" during bootstrap * Combinations of any of the above Again, this might not be the case in reality but I think removing the risk is worthwhile. ------------- PR: https://git.openjdk.org/jdk/pull/12193