I'm working on a client/server application on windows 7, where both the client and the server have a multithreaded architecture, more precisely, three threads per application, the first for receiving messages, the 2nd for analysing them and processing and the 3rd for sending answers. when I implemented this architecture, sometimes I have deadlocks, I don't know why? the code of the two threads that uses MPI is below, I think the problem is the the blocking callls, So, is there any alternatives? what I tried to do is make the whole connection session uninterruptible but i couldn't find a way to do it.
// wait up for a new message
emit WriteLine("waiting for connections on <" + QString::fromStdString(myPort) + ">\n");