Re: [gtk-list] Re: Announce: The General Proxy Kit (GPK)




Sascha Ziemann <szi@aibon.ping.de> writes:

> Scott Dybiec wrote:
> 
> > http://www.humanfactor.com/gpk/ for more details.
> > 
> > Very interested in your feedback. Is this a library worth enhancing?
> 
> It is absolutely necessary to make GTK threadsafe. If this is the only
> way, it is worth to enhance it. But a threadsafe GTK would be nicer,
> because other language bindings would profit. Guile for example has
> threads.

It should be pointed out that there is another approach to
using the _current_ GTK in a thread-safe manner, which if
not quite as nifty as GPK, probably will perform better for
many applications. 

(Method from Rob Browning)

Set up one global GTK lock.
Acquire it before doing any GTK operations
   Release it after doing the operations
Release it first thing in a callback
   Acquire it before exiting the callback
Set up an idle handler which releases the lock, sleeps for
   a bit, and re-acquires it.


I think the first step in making GTK useable in threaded programs
is providing a bit more support for this method. (Automatically
release the lock over the select() in the event loop, and provide
lock/unlock functions) This would be fairly easy to do except
for configuration hassles. 

(But when integrating with Guile, which uses (used?) the QuickThreads
package instead of pthreads, builtin support in GTK using pthreads
wouldn't do any good)

Regards,
                                        Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]