Concurrency

Yield point

Place in code where the scheduler may preempt.


In plain terms

In cooperative schedulers, only at explicit yield points. Pre-1.14 Go could only preempt at function calls — a tight loop blocked the P forever.

Origin

Cooperative schedulers have had yield points forever; the modern concern is whether they're inserted automatically. Go 1.14 (2020) made goroutine preemption asynchronous, fixing a long-standing class of bugs.

Where it shows up in production
  • Go runtime Pre-1.14: only at function calls. 1.14+: asynchronous, signal-based.
  • Java green threads / Loom Virtual threads in Java 21 park at I/O calls — the JVM's yield point analogue.
On Semicolony
Sources & further reading
Found this useful?