Hi,
I came across two questions regarding the hybrid barrier that I am hoping someone can help with.
1.
Chang https://go-review.googlesource.com/c/go/+/31765 says:
"It's unconditional for now because barriers on channel operations require checking both the source and destination stacks and we don't have a way to funnel this information into the write barrier at the moment."
Can anyone help in understanding the statement, say with a sample? Isn't "channel operations involving both stacks" already covered by runtime.sendDirect?
2. comments in mbarrier.go says
// The insertion part of the barrier
// is necessary while the calling goroutine's stack is grey. In
// pseudocode, the barrier is:
//
// writePointer(slot, ptr):
// shade(*slot)
// if current stack is grey:
// shade(ptr)
// *slot = ptr
What does "grey stack" mean? Is a stack considered 'grey' right after its goroutine gets suspended, scanned and resumed to execution?
Thanks a lot.
Hi,
I came across two questions regarding the hybrid barrier that I am hoping someone can help with.
1.
Chang https://go-review.googlesource.com/c/go/+/31765 says:
"It's unconditional for now because barriers on channel operations require checking both the source and destination stacks and we don't have a way to funnel this information into the write barrier at the moment."
Can anyone help in understanding the statement, say with a sample? Isn't "channel operations involving both stacks" already covered by runtime.sendDirect?
2. comments in mbarrier.go says
// The insertion part of the barrier
// is necessary while the calling goroutine's stack is grey. In
// pseudocode, the barrier is:
//
// writePointer(slot, ptr):
// shade(*slot)
// if current stack is grey:
// shade(ptr)
// *slot = ptr
What does "grey stack" mean? Is a stack considered 'grey' right after its goroutine gets suspended, scanned and resumed to execution?
Thanks a lot.