GNOME Bugzilla – Bug 319871
drop GIL state lock when doing something that can cause a property notify to be emitted
Last modified: 2006-07-02 15:32:39 UTC
The class lock that is taken in gstobject::dispatch_properties_changed can cause deadlocks when doing emissions. Consider an application written in a language that has to hold a global lock G at all times, and two objects A and B of type T. Application thread: B.connect(my_func) Streaming thread: B.notify('foo') Streaming thread: T.lock() (via gstobject::dispatch_properties_change) Streaming thread: G.lock() (blocks until application thread drops G) Application thread: A.set_property('foo') Application thread: A.notify('foo') (via the gobject notify system) Application thread: T.lock() (deadlocks) The class lock is unnecessary for GLib 2.8 and so is not taken. However something will have to be done for GLib 2.6. Assigning to Mr. Vander Stichele :)
(specifically: drop gil state lock when doing GObject.set_property() or GObject.notify())
this isn't a gst-python bug, it's a pygtk bug. There's nothing we can do in gst-python about uses of PyGObject API :(
Edward: if you have a test case for PyGTK please let me know
Edward: sure you can't hack around this in gst-python for 2.6? It would require overriding GstObject.set_property and GstObject.notify, so that they drop the GIL lock while in the set_property or notify.
argh, another 2.6 hack... sure, I'll try to do that
You got a plan for this, Edward?
I have to add some stuff to configure.ac to figure out if we're compiling against glib/pygtk 2.6. Then I can do some #ifdef'd sections of code with overrides for GstObject.set_property and GstObject.notify. The problem with this is the check is only done at compile time. So the other option would be always overridding those two methods... but I guess pygobject>=2.8 already does that.
ping?
ping2? lowering priority if nobody cares...
We could just require glib 2.8 for the python bindings
since gstreamer core has switched to glib >= 2.8 ,I think it's high time we do the same for gst-python and remove the 2.6 cruft
gst-python now requires glib >= 2.8.0 Marking bug as fixed.