[PyQt] deadlock when using new style signal / slots

Erik Janssens Erik.Janssens at conceptive.be
Mon Sep 6 23:01:55 BST 2010


Hello Pete,

it might indeed be that the deadlock is not directly
related to the new style signal slot, since the deadlock
might become visible due to a slight timing difference
cause by eg switching to new style signal slots.

however I wonder wether I'm doing anything wrong by 
connecting and emiting the same signal object at the
same time (I did experiment with the connection type,
but without result).  For now I have put a mutexlock around
this particular instance, but I wonder if I should mutex
all possible cases ??

The camelot website (www.python-camelot.com) should be
up and running, I was not aware of any downtime, it's
hosted at weebly.com.  The project is going well, we've
put a lot of work in switching from MDI to tab based and
are now converting to new style signal/slots because we
noticed stability improvements by using them.  These
deadlocks are of course bothering me.

Best regards,

Erik

On Mon, 2010-09-06 at 10:43 +0200, Hans-Peter Jansen wrote:
> Dear Erik,
> 
> On Friday 27 August 2010, 21:56:14 Erik Janssens wrote:
> > Hi,
> >
> > Another issue popped up when porting our code to
> > new style signal slots.
> >
> > it appears the deadlock occurs when one thread is
> > emitting using a pyqtSignal object, while another
> > thread is connecting the same pyqtSignal object to
> > a slot,
> 
> I don't believe, that this is _directly_ related to the new style 
> signal/slot idiom, but you might want to experiment with the connection 
> type argument of connect. 
> 
> > this is the pseudocode for the connection : 
> >
> > class(...):
> >
> >     def __init__(...):
> >       self.rsh.entity_update_signal.connect( self.handle_entity_update )
> >
> >     @QtCore.pyqtSlot( object, object )
> >     def handle_entity_update( self, sender, entity ):
> >         ...
> >
> > Are these operations supposed to be thread safe or am
> > I missing something ?
> >
> 
> BTW, the camelot website http://www.python-camelot.com/ seems to be down 
> since some time.. What's the state of your project?
> 
> Best regards,
> Pete




More information about the PyQt mailing list