←back to thread

159 points mpweiher | 1 comments | | HN request time: 0.238s | source
Show context
anarki8 ◴[] No.43672225[source]
I find myself using channels in async Rust more than any other sync primitives. No more deadlock headaches. Easy to combine multiple channels in one state-keeping loop using combinators. And the dead goroutines problem described in the article doesn't exist in Rust.
replies(5): >>43672313 #>>43672959 #>>43674608 #>>43674871 #>>43675417 #
1. pornel ◴[] No.43674871[source]
Channels are only problematic if they're the only tool you have in your toolbox, and you end up using them where they don't belong.

BTW, you can create a deadlock equivalent with channels if you write "wait for A, reply with B" and "wait for B, send A" logic somewhere. It's the same problem as ordering of nested locks.