]> Cypherpunks repositories - gostls13.git/commit
runtime: implement async scheduler preemption
authorAustin Clements <austin@google.com>
Sun, 13 Oct 2019 01:23:29 +0000 (21:23 -0400)
committerAustin Clements <austin@google.com>
Sat, 2 Nov 2019 21:51:21 +0000 (21:51 +0000)
commit177a36a5dc29854489825e8113ecb2cbb7070690
tree65d2a8130d8c57a6d48dd7fdc203649156c37934
parent62e53b79227dafc6afcd92240c89acb8c0e1dd56
runtime: implement async scheduler preemption

This adds signal-based preemption to preemptone.

Since STW and forEachP ultimately use preemptone, this also makes
these work with async preemption.

This also makes freezetheworld more robust so tracebacks from fatal
panics should be far less likely to report "goroutine running on other
thread; stack unavailable".

For #10958, #24543. (This doesn't fix it yet because asynchronous
preemption only works on POSIX platforms on 386 and amd64 right now.)

Change-Id: If776181dd5a9b3026a7b89a1b5266521b95a5f61
Reviewed-on: https://go-review.googlesource.com/c/go/+/201762
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/preempt.go
src/runtime/proc.go
src/runtime/runtime2.go