On Mon, Oct 31, 2016 at 12:15 PM, Benoît Canet <[email protected]>
wrote:

>
> How can we be sure go does not use static tls ?
>

It probably does - I was only answering about non-static TLS because you
said Go was using that too (I don't know if it in fact does).

The static TLS initialization problem I tried to explain in my previous
mail probably explains the peculiar hoops you needed to jump through to get
Go (which uses static TLS) to run properly:

1. Static TLS is only allocated for a shared-object in threads created
*after* they are loaded
2. The initialization functions of the shared object may use this static
TLS, but not find it in the current thread (they will find it in any new
thread)

Why is why you needed to do your splitting - setup static TLS (which will
effect new threds), then create a new thread, and then, in it, run the
initialization functions.

I think it should be possible, but perhaps not very easy, to fix
init_static_tls to resize and rebuild the current thread's static TLS area
- not just set up the one for new threads. If we would do that, we won't
need to split the loading and initialization parts like you had to do.
Moreover, things would work even if we chose not to create a new thread at
all.

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to