4 ms·
Great post! One question that lingered for me is: what are asynchronous safe-points? The post goes into some detail about their synchronous counterparts
by ollien 2y ago
Great post! One question that lingered for me is: what are asynchronous safe-points? The post goes into some detail about their synchronous counterparts
- MathMonkeyMan 2y agoI don't know, but I remember hearing in a talk that the compiler had to be modified to insert them into the generated code. Here's `isAsyncSafePoint`: https://github.com/golang/go/blob/d36353499f673c89a267a489beb80133a14a75f9/src/runtime/preempt.go#L363 https://github.com/golang/go/blob/d36353499f673c89a267a489be... edit: The comments at the top of that file say: // 3. Asynchronous safe-points occur at any instruction in user code // where the goroutine can be safely paused and a conservative // stack and register scan can find stack roots. The runtime can // stop a goroutine at an async safe-point using a signal.