~/talk

Deep Dive into the Select Statement

slides:none on file

Compiler lexing/parsing/typecheck turns select into IR/SSA and special-cases it: zero-case becomes a call to runtime.block, single-case and single-plus-default emit nonblocking helpers (selectnbrecv/selectnbsend), and multi-case delegates to runtime.selectgo. runtime.selectgo shuffles cases with cheaprand, locks channels in address-sorted order to avoid deadlocks, checks readiness, subscribes the goroutine to all channels’ wait lists, and desubscribes on wake; selection is randomized for fairness and there is no built-in priority. Version targeted is Go 1.26.5.

AI-written summary · about

  1. 0:00Introduction
  2. 1:50Select statement in Go
  3. 6:05Compiler’s role
  4. 11:25IR optimizations for select
  5. 14:18Runtime execution
  6. 18:33SelectMB send/receive
  7. 21:25Select function in runtime
  8. 29:48Compiler’s final handling
  9. 31:13Key characteristics
  10. 32:59References
  11. 33:41Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.