Thread-local successor for object pooling

Pedro Lamarão pedro.lamarao at prodist.com.br
Thu Nov 3 14:55:17 UTC 2022


Em qua., 2 de nov. de 2022 às 15:07, Carter Kozak <ckozak at ckozak.net>
escreveu:


> My fear, however, is that by making ThreadLocal support on a per-thread
> basis configurable, we make them dangerous to use in any code that cannot
> be directly traced to thread creation (all library code). While the current
> proposal does not deprecate ThreadLocal, I would argue that they become de
> facto deprecated once they’re no longer guaranteed to work depending on
> external factors (the thread an external caller used).
>

I agree.
This will transitively introduce a new error condition on all code paths
which *may* invoke TL.set.
Test suites for such code will have *less* coverage.
I believe coding manuals will declare this feature off limits for everyone
except the most expert framework implementation teams.

-- 
Pedro Lamarão
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20221103/a295d556/attachment.htm>


More information about the loom-dev mailing list