Summary

How channels work?

  • hchan struct represents channel.
  • It contains circular ring buffer and mutex lock.
  • Goroutines tha gets blocked on send or recv are parked in sendq or recvq.
  • Go scheduler moves the blocked goroutines, out of OS thread.
  • Once channel operation is complete, goroutine is moved back to local run queue.
© Kimi Tsai all right reserved.            Updated : 2023-07-12 09:04:54

results matching ""

    No results matching ""

    results matching ""

      No results matching ""