On Sat, Feb 9, 2019 at 5:07 PM Milind Chabbi <milis...@gmail.com> wrote: > > Can you give me more details about these terms: "g0", "systemstack", and > "mcall"?
In Go, goroutines are multiplexed on to threads, so there are typically many more goroutines than there are threads. Each thread has an associated goroutine that is used when entering the runtime scheduler. That goroutine is called the g0 goroutine for the thread. The g0 goroutine has a larger stack, namely the OS-allocated stack for the thread. systemstack is a function in the runtime package which invokes a closure on the current thread's g0 goroutine. mcall is a function in the runtime package which calls a function on the current thread's g0 goroutine, passing the current g; the invoked function must never return, but must instead continue execution by calling gogo. > Robert: taking the trace route is incorrect for me; I am profiling, tracing > is too expensive because of logging, furthermore, I don't want to recompile > the application or change the go runtime. Note that the tracing we are talking about is the tracing built into the Go runtime, not the tracing done by the perf tool. 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. For more options, visit https://groups.google.com/d/optout.