javax.imageio.ImageIO ThreadLocal use

Alan Bateman Alan.Bateman at oracle.com
Tue May 9 18:01:43 UTC 2023



On 09/05/2023 18:46, Duncan Gittins wrote:
> :
>
> I happened to be stripping out all my ThreadLocal code recently, and 
> so decided to check this work by adding "allowSetThreadLocals(false)" 
> onto all virtual thread builders to disable ThreadLocal use.

We decided not to make allowSetThreadLocals a permanent API so it has 
been removed for Java 21. JEP 444 [1] provides a bit on the reasons for 
this.

We haven't discussed the TL usage in the image I/O area here. Most of 
the effort on reducing usages of TL has been in the base/core area. If 
you have proposals/ideas for reducing the usage in the image I/O code 
then it would be good to bring them to client-libs-dev? If the TLs are 
for caching purposes then it's good to create some benchmarks to see if 
the caching helps or makes things worse.

-Alan

[1] https://openjdk.org/jeps/444


More information about the loom-dev mailing list