[go-nuts] about "hybrid barrier"

2023-07-28 Thread metronome
 

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.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/a36d3b5f-144b-446d-83a6-746394d2d99an%40googlegroups.com.


[go-nuts] about "hybrid barrier"

2023-07-28 Thread metronome
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. 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/797952e5-bd27-423f-91cc-e5b5ac46f4d1n%40googlegroups.com.