Question on small optimization

Alan Bateman alan.bateman at oracle.com
Wed Dec 24 08:04:32 UTC 2025


On 23/12/2025 22:04, Dmitry Zaslavsky wrote:
> Hello loom developers, thank you for your great work.
>
> Quick question:
> I must be missing something very obvious, but why not move the fields
> |threadLocalRandomSeed|
> |threadLocalRandomSecondarySeed|
> |ThreadLocalRandomProbe|
> Into |FieldHolder|
> And have |ThreadLocalRandom ||always just use ||carrierThread|
> |The benefit would be a smaller size for VirtualThread and I would 
> argue no worse properties for TLR?|
>
It's a good topic. We have done some experiments with this but does have 
some impact on the TLR methods due to the additional fetch. Doug Lea, 
Viktor Klang and I have been discussing a number of variants, e.g. using 
fields on ForkJoinWorkerThread. Maybe some progress on this in the new year.

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20251224/b7a10596/attachment-0001.htm>


More information about the loom-dev mailing list