Sonntag, 14. Juni 2009

simond: Thread Termination

Some users told us that when simon crashed / closed under certain conditions, the simond would be trapped in an infinite loop.

To accept any new connections, simond had to be restarted.

This was caused by the implementation of the TCP/IP adin. Once a client would be connected (data connection to synchronize the model), a new socket would be opened for the audio stream. This was implemented using the accept() method which blocks until a connection is made.

While this was in a different thread as the main event loop this was no problem most of the time. However, when the client connected through the data channel but didn't establish an audio connection this socket would be blocking in accept(). When the client exited, the thread should by terminated by the main event loop but the thread event loop would still block waiting for a connection.

This resulted in the debug output "QThread::start: Thread termination error" which was printed over and over again.

Because I really don't want to modify too much of Julius to keep it synchronized to the SVN version I added a little workaround in the stop() routine: I simply connected to the socket and disconnected immediately.

So starting with revision 862 simond should not hang any longer and should be more stable in general.

Keine Kommentare: