Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
vc8f6vVV
2y ago
0 comments
Share
Channel with an additional thread for sleep? Waiting for a channel is not a poll.
0 comments
default
newest
oldest
conradludgate
2y ago
You either wait on the channel or wait on a read. How do you manage both?
vc8f6vVV
OP
2y ago
You wait on a shared channel so both read and sleep threads queue a message when ready (whichever comes first). Not sure about channels, but in other languages it would be a concurrent queue.
conradludgate
2y ago
This won't cancel the read, it'll just ignore the result
1 more reply
j
/
k
navigate · click thread line to collapse