Thread Locals (was Re: State of Loom)
Alen Vrečko
alen.vrecko at gmail.com
Thu May 28 14:01:40 UTC 2020
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