[Twisted-Python] wxPython locking the event processing?

Patrik Blommaskog pb_twisted at olga.mine.nu
Sat Jul 5 10:24:49 MDT 2003


> On Sat, 2003-07-05 at 10:52, Patrik Blommaskog wrote:
> > Hi list,
> >
> > Using Twisted/wxPython/Win2k, it seems to me like Twisted's
> event processing
> > gets locked up while I'm moving around in a menu (without selecting
> > anyting). For example, if there is a callLater() pending, but
> the menu bar
> > is activated when the time occurs, the call is not made until I
> leave the
> > menu.

[problem reproduction removed]

> > Now, I would really like for my model to keep working in the background
> > while I'm moving around in the GUI.
> >
> > Any suggestions?
> >
> > - Patrik
>
> try this

[example removed]

Thanks, it looks like it should do the trick. My first attempt to apply it
to my application failed, and I believe it is because my app uses a Twisted
Application, so it needs to drive the app's loop instead of the reactor's
directly, I suppose (which also failed because the Twisted Application wants
to install a signal handler, and it can only do that in the main thread).
The effect I got now was that the application wouldn't listen to the port.
I'll investigate it further.

Meanwhile, is there anything that I should be aware of considering that we
now have separate threads for wx and Twisted? Can I for example use
reactor.callLater() to call methods on wx objects, or work with
Perspectives, Cacheables, reactor etc from wx event handlers without any
problems?


- Patrik






More information about the Twisted-Python mailing list