6 ms·
Sending to a closed channel is fatal, as is closing it. There's no way for multiple senders sending to a channel to tell if somebody closed it without risk of c
by Animats 10y ago
Sending to a closed channel is fatal, as is closing it. There's no way for multiple senders sending to a channel to tell if somebody closed it without risk of crashing.
Graceful shutdown of systems with lots of asynchronous communication is hard, but this makes it harder than it has to be.
- nothrabannosir 10y agoI was wrong; this is true. the soft-reading thing only works for reading. You can't soft-write with select to a closed channel, it will crash even with a default clause. *sigh, after all that time I still make this mistake. Goes to show how often I actually use channels. :/