Also, is there a way to print the values of runtime.g?

On Thursday, September 10, 2020 at 12:15:04 PM UTC+9 Ian Lance Taylor wrote:

> On Wed, Sep 9, 2020 at 7:39 PM Yonatan Gizachew <eme...@gmail.com> wrote:
> >
> > This might be trivial, but could you explain me the relationship between 
> the following?
> > 1. value returned by __tls_get_addr
>
> This is the address of the TLS control block. The exact definition
> depends on the architecture. All TLS variables are at some offset
> from this value.
>
> > 2. runtime.g
>
> A TLS variable that holds the current goroutine, a pointer to a g struct.
>
> > 3. runtime.g0
>
> A global variable that holds the g struct used for the initial goroutine.
>
> > 4. runtime.m0
>
> A global variable that holds the m struct used for the initial thread.
>
> > 5. runtime.m
>
> gccgo no longer uses this. In earlier releases it was a TLS variable
> that holds the current thread, a pointer to an m struct. In current
> releases gccgo uses g->m for this.
>
> Ian
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0935d7c3-d2de-49cd-8d25-196b276c5ca9n%40googlegroups.com.

Reply via email to