Thread Locals (was Re: State of Loom)

Ron Pressler ron.pressler at oracle.com
Thu May 28 16:43:27 UTC 2020


Can you explain your use case? We have some ideas and will make
some suggestions, perhaps encapsulated as a new core libraries construct,
but the more we know about which use-cases cause particular pain, the
better we can address them.

But let me be clear: the carrier will *not* be accessible by reflection. The base 
module will be closed to deep reflection by default before Loom is delivered.

— Ron


On 28 May 2020 at 15:04:19, Alen Vrečko (alen.vrecko at gmail.com) wrote:

Some of us will just use reflection to get the carrier thread.  

When I went trough the production code and made it play nice with loom. In  
most cases I could find nicer alternatives to TL usage. There aren't many  
TLs being used anyway. But in one particular case I just gave up. The  
alternative is rather involved and in my view convoluted. I opted to get  
the carrier thread reference via reflection and used it to make effectively  
a TL. Simple and it got the job done.  

It might be a good compromise. Find alternatives to TLs. But if there are  
no good alternatives, here is a reference to carrier tread, use it at your  
own risk.  

Alen  


More information about the loom-dev mailing list