[Twisted-Python] Twisted with wxPython in a thread

Gabriel Rossetti gabriel.rossetti at arimaz.com
Tue Aug 24 17:00:42 EDT 2010

On 08/24/2010 04:37 PM, Stephen Waterbury wrote:
> On 08/24/2010 10:08 AM, Stephen Waterbury wrote:
>> On 08/24/2010 09:24 AM, Stephen Waterbury wrote:
>>> On 08/24/2010 09:22 AM, Gabriel Rossetti wrote:
>>>> Ok, so you put Twisted in a thread? I read in several posts that this
>>>> posed problems, have you had any drawbacks?
>>> I haven't observed any.
>> Reflecting on this a little further (and with the caveat that I
>> am a complete ignoramus on threading), it seems to me that
>> problems happen when Twisted is not in the main thread.  Note
>> that in the example, the reactor starts first (i.e., before the
>> wx event loop), so I guess it is in the main thread ... I haven't
>> tried switching them, but if you do that or anything that breaks
>> this method, please let me know -- as I say, I haven't seen it
>> break (freeze or otherwise malfunction) yet.
> BTW, Gabriel (sorry about spamming you about this -- this is the
> last thing I'll say, I promise! ;), I think what I said above is
> completely wrong:  the example code *is* running the reactor in a
> daemon thread -- it sets it explicitly using 'setDaemon(True)'.
> Anyway, if you get it to break, please let me know -- thanks!
> Steve

no worries Steve, it's cool of you to look into this. I'll give it a try 
if I can't get the wx-in-a-thread code to work by tomorrow. I just want 
to check some things first to make sure it's not another problem hiding. 
Thanks for your help, I'll keep you up to date!


More information about the Twisted-Python mailing list