I have applied a modified version of Duncan Grisby's threading patch to
CVS (it is modified so that it does not affect non threaded copies of
python). You could try checking it out of CVS, or if you don't want to go
to the trouble of CVS and patching automake, get a nightly snapshot of
gnome-python from ftp.jimpick.com and copy gtkmodule.c and gtk.py to the
build directory. It should have an "#ifdef WITH_THREAD" close to the top
if it is the correct version.
With that one, you should be able to thread the application (unless I made
some mistakes altering Duncan's patch), and when you want to call GTK
routines from another thread (ie. not from a signal handler or other
callback), call threads_enter() before and threads_leave() after.
If no one sees any bugs in this code, I will release it soon.
James Henstridge.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
On Thu, 8 Apr 1999, Richard Fish wrote:
> Lars Hoss wrote:
> >
> > Hi everyone,
> >
> > I am new to this list, so I do not know wether
> > this question was asked by someone else.
> >
> > I am working on a litle tool which helps me to
> > synchronize two databases on different hosts.
> > Now if I push the go button I want to show
> > the progress with a progress bar. but
> > due to the heavy calculations the GUI is frozen.
> > So I tried to put the calculations into an extra thread,
> > but this seems not to work?
> >
> > Anyone who can help me?
>
> Generally, you have three choices here:
>
> 1 - You can do "while (events_pending()): mainiteration(FALSE)" within
> your calculations to flush any pending events.
> 2 - Do the calculations in a separate thread. Note that control appears
> to need to return to python for thread switches to occur, so you may
> have to implement your event loop and calculations in python.
> 3 - Do the calculations in a separate process, using standard unix IPC
> to communicate (pipes, sockets, shared memory, etc...)
>
> Of the three, 2 sounds like the cleanest solution for your problem so
> you are probably on the right track.
>
>
> --
> Richard Fish Enhanced Software Technologies, Inc.
> Software Developer 4014 E Broadway Rd Suite 405
> [EMAIL PROTECTED] Phoenix, AZ 85040
> (602) 470-1115 http://www.estinc.com
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
>
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]