You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could use runtime.LockOSThread() to block Goruntime from switching the goroutine via async preemption which can happen at any point of execution.
Even though we've tested the JIT execution is stable without locking (as in jit/engine_test.go ), there might be still some condition where the JIT would fail.
This needs more through investigation on how Goroutine saves CPU registers when switches happens (at source code level), and more test cases to ensure whether or not we need thread blocking via LockOSThread.
The text was updated successfully, but these errors were encountered:
Be aware that parking/unparking threads under runtime.LockOSThread() seems to cause context switches golang/go#21827
I suspect that locking will also cause context switches on any goroutine that have accumulated on the M in question since the last time it was locked, but I could be wrong about this.
We could use
runtime.LockOSThread()
to block Goruntime from switching the goroutine via async preemption which can happen at any point of execution.Even though we've tested the JIT execution is stable without locking (as in jit/engine_test.go ), there might be still some condition where the JIT would fail.
This needs more through investigation on how Goroutine saves CPU registers when switches happens (at source code level), and more test cases to ensure whether or not we need thread blocking via
LockOSThread
.The text was updated successfully, but these errors were encountered: