Closed evan-schott closed 1 year ago
Use go channel to signal between receiver and sender
Note that this is not a hard requirement. You might find it simpler to use a mutex to protect some fields, e.g.
type syncChan struct {
mu sync.Mutex
sendrReady, recvrReady bool
value capnp.Ptr // the value being transferred from sender to recver
}
(Then again, maybe the channel is actually easier. Your call.)
https://hackmd.io/@fCsHyW7yR3C5lGQFbh9KdQ/BkiAsWeTs
☝️ POC implementation using sync.Cond
+ important notes about correctness.
Closing per #88
Create implementation in wetware/ww/pkg/csp/basic.go by following the flow chart below. Use go channel to signal between receiver and sender, and lock to control access to sent value.