save context, when switch goroutine?

81 views
Skip to first unread message

xie cui

unread,
Sep 4, 2020, 6:13:54 AM9/4/20
to golang-nuts
as we know,  call function gogo can jump to other other goroutine. when goroutine1 switch to goroutine2 it must save the current context of goroutine1(sp pc. so). i can find the function runtime·gosave to save current context, but i cann't find where the code call gosave, can some explain when context switch where is the to call gosave, or maybe context save is in other code? 
if it call gosave to save context, what is the possible stack when call gosave?

xie cui

unread,
Sep 4, 2020, 6:59:38 AM9/4/20
to golang-nuts
I find the mcall function!
Reply all
Reply to author
Forward
0 new messages