After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 620901 - IO events make GUI unresponsive
IO events make GUI unresponsive
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: general
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-07 20:41 UTC by Jp Calderone
Modified: 2012-04-20 11:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jp Calderone 2010-06-07 20:41:03 UTC
Consider the attached example.  It reads and writes using non-blocking I/O and gobject.io_add_watch.  It also tries to display a label.  However, the label never actually manages to be rendered because the I/O is always given priority.
Comment 1 Jp Calderone 2010-06-07 21:16:24 UTC
On the #pygtk IRC channel on gimpnet, I learned that there's an undocumented `priority` keyword argument accepted by `gobject.io_add_watch`.  By experimenting with different values for this keyword, I was able to make the GUI in the example responsive.

It would be great to document this parameter.  I also wonder if it's worth considering the decision to make I/O events higher priority than GUI redraws (expose events?).
Comment 2 John Stowers 2010-09-26 21:00:34 UTC
glib.io_add_watch mentions the priority keyword in docs.
Comment 3 Jp Calderone 2010-09-26 21:38:02 UTC
It would be quite nice if it were mentioned here:

$ pydoc glib.io_add_watch
Help on built-in function io_add_watch in glib:

glib.io_add_watch = io_add_watch(...)
    io_add_watch(fd, condition, callback, user_data=None) -> source id
      callable receives (fd, condition, user_data)
    Arranges for the fd to be monitored by the main loop for the
    specified condition. Condition is a combination of glib.IO_IN,
    glib.IO_OUT, glib.IO_PRI, gio.IO_ERR and gio.IO_HUB.

Or if these docs were removed and replaced with a reference to the documentation on the website.  The existence of the above API documentation strongly implies there is no `priority` keyword (cutting short a search for any further information on the topic).  Additionally, the priority documentation at http://library.gnome.org/devel/pygobject/stable/glib-functions.html#function-glib--io-add-watch strikes me as rather suboptimal.  `priority` is not included in the function signature and there's no suggestion of what acceptable values might be.
Comment 4 John Stowers 2010-09-26 21:53:21 UTC
Moving to pygobject as it will see a reorganization this cycle.
Comment 5 Dieter Verfaillie 2012-04-20 11:49:26 UTC
Thanks for taking the time to report this bug. However, this
bug report applies to a PyGObject version that is too old and
not supported anymore. PyGObject developers are no longer working
on static bindings, so unfortunately there will not be any bug
fixes for the version this report applies to.
 
By upgrading to a newer version of PyGObject you could receive
bug fixes and new functionality. Please feel free to reopen this
bug if the problem still occurs with a newer version of PyGObject.