Hello, I have a question about the bottom of the goroutine

107 views
Skip to first unread message

王晚成

unread,
Oct 6, 2017, 12:23:29 PM10/6/17
to golan...@googlegroups.com
hello ,
         I have a question about the bottom of the goroutine.
        What is the meaning of the mstartfn field inside the M structure under runtime2.go?
        Is this mstartfn the function that we write behind the go statement?
        Or what other functions?
        Thanks very much!

Ian Lance Taylor

unread,
Oct 6, 2017, 1:24:31 PM10/6/17
to 王晚成, golang-nuts
mstartfn is used to start a few special purpose functions on a new M.
Specifically, in current master, the possible values are sysmon (the
system monitor thread), mhelpgc (a new thread ready to help the GC in
the future), and mspinning (starts the new thread in spinning state to
maintain some bookkeeping).

Ian
Reply all
Reply to author
Forward
0 new messages