Scoped variables

John Rose john.r.rose at oracle.com
Wed Dec 5 00:10:44 UTC 2018


On Dec 4, 2018, at 2:06 PM, dean.long at oracle.com wrote:
> 
> I'd like to hear more about static thread locals and how they could be
> implemented.  It's not clear to me how we would implement something
> dynamic on top of the something static.

In my (perhaps hasty) response to David, I assumed what he meant
was something like this:  Pick a small N, allocate N fields somewhere
inside each Thread, either lazily or eagerly, and hand out tickets to
requesters for "static TLs", turning them away at the door when N tickets
have been handed out.  Or maybe handing latecomers a consolation prize
of an ordinary dynamic TL.  This sort of thing is not a bad idea, but I don't
think Thread is the place to look for context, for the reason I gave.

> dl
> 
> On 12/4/18 1:46 PM, David Lloyd wrote:
>> Passing hidden values is a good use case for static thread locals
>> (assuming they would utilize just a couple of lookups).  In fact
>> static thread locals can be used to implement probably most of the
>> suggested mechanisms...
> 



More information about the loom-dev mailing list