On Tue, Apr 12, 2005 at 09:08:47PM -0700, Brian wrote:
> I have a problem in that another python program (not under our
> development) we import is not thread friendly.  The problem I have is
> that mostly it is imported and used from the base thread, but there are
> several areas of code that need to run from a thread so as to not tie up
> the mainloop and general gui operations.  The result is intermittent
> segfaults/ lately it does:
> 
> Fatal Python error: PyThreadState_Get: no current thread
> Killed
> 
>   I have thought of recoding and spawning a process that imports the
> program to act as a server, but that would entail pickling/unpickling
> the python data types to pass thru pipes, etc..
> 
> Is it possible to run the mainloop of our program from another thread?

As far as I understand this shouldn't be a problem for linux and
other unix variants. But I have only tried it once and that was
with a very small test program. If you want more I have a number
of demo programs that shouldn't be difficult to adapt for testing
this out. Maybe I can find some time this week.

> Is it dfficult/not advisable? 

Just start a thread where you call gtk.main.

-- 
Antoon Pardon
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to