[Qt-interest] how to debug a deadlock

Carsten Breuer CarstenBreuerQt at textwork.de
Wed Jul 14 20:56:59 CEST 2010


Hi Mathias,

> That came also to my mind, however I I start implementing such a 
> function, I could rewrite the whole dll.
> The problem is mainly the time I have to do that. Rewriting the dll 
> (which is 10+ years old, and not threadsave designed)
> would be the best solution anyway.

>From my point of view the problem is not the dll, but
the misuse of it. A serial port can't be shared. Serialization
is required and of course it is your job to do this.

A lock of mutex in the same thread creates "of course"
a deadlock and Qt reports this in the debug window.

If a queue is the right approach depends on your app.
If you have a request->response type of communication,
then a mutex is enough. If you have a debug logger,
a thread with a ring buffer is perfect, ....


Best Regards,



Carsten



More information about the Qt-interest-old mailing list