Why not event-driven packages in other than the main thread?

Tor Erik torerik81 at gmail.com
Thu Sep 14 09:05:28 EDT 2006


Jean-Paul Calderone wrote:
> On Thu, 14 Sep 2006 11:13:59 +0200, Tor Erik <torerik81 at gmail.com> wrote:
>> Hi,
>>
>> I've developed an application were I've used Tkinter for the GUI.
>> When I ran the GUI in another thread than the main, it kept locking
>> up.
>> I experienced similar problems with Twisted.
>>
>> Both of these tools are event-based, so I guess that is the root of the
>> problem...
>>
>> But could anyone tell me why running these in a thread other than the
>> main one doesn't work?
> 
> I don't know about Tkinter, but Twisted can be run in a thread other than
> the main thread.  Several projects make use of this feature extensively, so
> while I wouldn't recommend it, it should certainly work.
> 
> Perhaps you did something wrong in setting it up, or perhaps you have found
> a bug.  Can you post a minimal example to reproduce this to Twisted's bug
> tracker?
> 
> Jean-Paul

Oh... I've re-coded that part of my app. now, so it doesn't contain any 
references to Twisted anymore. However, I was aiming to build a scalable 
HTTP server, and tried using Twisted for the task. Whenever I started 
the thing from the main thread (as a separate thread), nothing happened. 
That is, I received no exceptions, but the HTTP server was not 
running... When executing the HTTP server as a separate app., things 
worked perfectly.



More information about the Python-list mailing list