News for hackers. Stuff that matters.
Re:Asynchronous IO in Rust by devit on Wednesday September 16, 2015 @07:07PM (#10230588)
"Communicating" doesn't solve deadlocks.

Thread 1 sends message A to thread 2 and waits for a response.

As part of processing message A, thread 2 sends message B to thread 1 and waits for a response... forever, since thread 1 is blocked waiting for thread 2...

Re:Asynchronous IO in Rust by acconsta on Wednesday September 16, 2015 @08:18PM (#10230851)
I don't understand that scenario — isn't message B the message thread 1 is waiting for?

And to be fair, it does significantly reduce the risk of deadlock by avoiding the complexity of explicit mutexes and condition variables.

Re:Asynchronous IO in Rust by Gankro on Wednesday September 16, 2015 @09:06PM (#10230991)
A simple example of this would be two threads with two channels to each-other. A is in channel A, B is in channel B. While blocked on channel A, thread 1 can't handle messages in channel B.

Certainly a bit more contrived then deadlock with locks, though (which you can easily do with even a single thread, even in Rust).