Goroutine Pause or Halt
List the functions can stop or suspend the execution of current goroutine, and explain their differences.
Answer
runtime.Gosched: give up CPU core and join the queue, thus will be executed automatically.
runtime.gopark: blocked until the callback function unlockf in argument list return false.
runtime.notesleep: hibernate the thread.
runtime.Goexit: stop the execution of goroutine immediately and call defer, but it will not cause panic.