There is a partial solution we can do for Go1.2 with few casualties. Namely, make gcwaiting variable per-M. Sysmon() thread detects when an M runs the same goroutine for a long time and sets m->gcwaiting. When a thread notices m->gcwaiting, it calls into scheduler. If global gcwaiting is not set, it just causes rescheduling. This way worker threads be preempted on chan/map/malloc operations.
Owner changed to @dvyukov.
This issue was updated by revision b913cf8.
I believe the runtime is strong enough now to reenable preemption during the function prologue. Assuming this is or can be made stable, it will be in Go 1.2. More aggressive preemption is not planned for Go 1.2. R=golang-dev, iant CC=golang-dev https://golang.org/cl/11433045
This was referenced
Dec 8, 2014