Re: Reading from sockets in a multithreaded program
Originally Posted by danadam
Main thread waits for Connection thread to release semaphore and Connection thread waits for Main thread to process socket and deliver some data.
Try to move QSocket creation to run() method of Connection class and see if it helps.
This seems a plausible explanation. However, after trying this I still mange get the 'deadlock'. Only in about 5% of my tries, all data is received without problems.
Bookmarks