Re: [pygtk] Pygtk 1.99 and threading.

2001-11-29 Thread James Henstridge

Skip Montanaro wrote:

>James> Currently threading is not supported at all, which is why
>James> --enable-thread defaults to no for now.
>
>It's not obvious to me why pygtk needs to support the Glib/Gtk thread model
>if Python's is available already.  Other than being able to manipulate the
>user interface from multiple threads (which is no big win as far as I can
>tell), what does it buy you?
>
Well, we need the python and gtk threading models to work together. 
 Take a look at the THREADS file in the pygtk directory, which describes 
some of the problems.  Having either a free threaded python or recursive 
interpreter lock would make things a lot easier to implement.

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] Pygtk 1.99 and threading.

2001-11-29 Thread Skip Montanaro


James> Currently threading is not supported at all, which is why
James> --enable-thread defaults to no for now.

It's not obvious to me why pygtk needs to support the Glib/Gtk thread model
if Python's is available already.  Other than being able to manipulate the
user interface from multiple threads (which is no big win as far as I can
tell), what does it buy you?

-- 
Skip Montanaro ([EMAIL PROTECTED] - http://www.mojam.com/)
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] Pygtk 1.99 and threading.

2001-11-28 Thread James Henstridge

Tom Morton wrote:

>I'm using python 2.2b1, pygtk 1.99.5 and gtk 1.3.11.
>
>If i compile pygtk with --enable-thread then pygtk programs simply crash
>immediately with a segfault. without threading they work fine, but i need
>threading support. is there a way of getting the nice tasty threads_enter/
>leave() thing that pygtk 0.6.x had, or any way of using threading?
>
Currently threading is not supported at all, which is why 
--enable-thread defaults to no for now.

Sopwith produced a patch (which was a bit of a hack) to support 
threading.  Given the current schedule, we should probably put in some 
threading support based on these patches.

This support will probably be turned off by default, but be possible to 
turn on at runtime (this is to mirror gtk+, where threading must be 
explicitly enabled with the gdk_thread_init() call now).  It will most 
likely look something like:
  import gtk
  gtk.enable_threads()

I have slightly modified zilch's threads disable patch on the stable 
branch (this is is a way to get round the applet/dialog deadlock problem 
someone was experiencing recently), to make it more convenient.  Now, 
you can do:
  import gtk
  gtk._disable_gdk_threading()

(this uses a hack suggested by owen, of setting gdk_thread_mutex to NULL 
after initialising gtk in order to disable gtk thread support).

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



[pygtk] Pygtk 1.99 and threading.

2001-11-28 Thread Tom Morton

I'm using python 2.2b1, pygtk 1.99.5 and gtk 1.3.11.

If i compile pygtk with --enable-thread then pygtk programs simply crash
immediately with a segfault. without threading they work fine, but i need
threading support. is there a way of getting the nice tasty threads_enter/
leave() thing that pygtk 0.6.x had, or any way of using threading?

-- 
Tom "Moretom" Morton (www.moretom.net)

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk