Re: [Orbit-python-list] Orbit-python and threading?
Status: Inactive
Brought to you by:
tack
From: Christian R. R. <ki...@as...> - 2001-11-07 20:36:06
|
On Wed, 7 Nov 2001, Marijn Vriens wrote: > I am trying to get some program to work with python-orbit. Because I > need it to do some more work besides just waiting for corba requests > to come in, and i didn't see any "idle" hooks (ala gtk.py), My > solution is to dump the Orbit run() in it's own thread, while the > rest of the processing goes on in the mainthread. Okay. This is a feature that we have been desiring for a while now, and if Tack thinks it's okay, i'd like to do a 0.3.2 pre-version that includes the ability to use the gtk mainloop. This does mean it's necessary to have pygtk installed and it requires a version of pygtk compiled without threads (or the latest pygtk with my patch to disable threading in runtime) but it does work. > Anyway, a strange thing happens, when I do that orb.run() the > application blocks (surprise!) nomatter that it's running in it's own > thread. If I replace the orb.run() with something like This is by design. Even noticed how pygtk blocks when you gtk.mainloop()? It's the same sort of idea. The server runs in a mainloop and in theory it is intended to only service user requests. If you do want to do client-side processing (have the server initiate actions/requests) then you will either need threads (which we don't support right now) or the gtk mainloop hack. I'm surprised your threading example doesn't crash, but I don't know threading very well at all. Tack? :) Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL |