holger krekel wrote:
> Hi Simon, 
> 
> On Wed, Apr 29, 2009 at 11:08 +1000, Simon wrote:
>> Hi Holger,
>>
>> On 28/04/2009, at 19:05 , holger krekel holger-at-merlinux.eu |py-dev|  
>> wrote:
>>
>>> i meant that GUI threads need the main thread to run their
>>> event loop.  With your patch execution will always run in
>>> sub threads on the remote side.
>> Just a quick question, why does the GUIs event loop need to run in the  
>> gateways main thread? I understand that all the widget initialisation  
>> and event handling has to be done from the same thread, but I don't  
>> understand why this can't be a created thread.
> 
> i don't know. It's something that people and web pages 
> told/tell me.  I am hardly doing GUI programming myself. 
> Is it maybe because only the main thread receives signals? 

I can't give the true explanation either, but it seems that it creates
awfully complicated code as soon as you stop assuming that the GUI does
not run in the main thread. And that's for a core component of a GUI
toolkit where things are quite complicated already.

It seems to be the explanation behind this decision, for example, for Qt:

"In Qt, one thread is always the GUI or event thread. This is the thread
that creates a QApplication object and calls QApplication::exec(). This
is also the initial thread that calls main() at program start. This
thread is the only thread that is allowed to perform GUI operations,
including generating and receiving events from the window system."

cheers,

Philippe

_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to