Y
Hacker News
new
|
ask
|
show
|
jobs
by
conradludgate
1018 days ago
You either wait on the channel or wait on a read. How do you manage both?
1 comments
vc8f6vVV
1018 days 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.
link
conradludgate
1018 days ago
This won't cancel the read, it'll just ignore the result
link
vc8f6vVV
1017 days ago
Most languages I know allow killing a thread, or at least unblock a system call.
link