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 658763 - GCancellable should not use an fd
GCancellable should not use an fd
Status: RESOLVED DUPLICATE of bug 680121
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-09-11 20:42 UTC by Allison Karlitskaya (desrt)
Modified: 2017-10-24 11:34 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Allison Karlitskaya (desrt) 2011-09-11 20:42:57 UTC
cf. bug 658743, GCancellable's direct use of GWakeup is a bit unfortunate.  It means that leaking GCancellable in your program will pretty quickly result in a crash due to running out of file descriptors.

Instead of using GWakeup for each GCancellable we should try to structure the cancellable source such that it uses the GWakeup of the main context to which it is attached.

We should then deprecate the functions that deal with file descriptors and GPollFD.
Comment 1 Dan Winship 2011-09-12 13:39:13 UTC
(In reply to comment #0)
> Instead of using GWakeup for each GCancellable we should try to structure the
> cancellable source such that it uses the GWakeup of the main context to which
> it is attached.

doesn't this go against the plan of deprecating prepare/check funcs?

> We should then deprecate the functions that deal with file descriptors and
> GPollFD.

note that GUnixInputStream, GUnixOutputStream, and GSocket make use of g_cancellable_make_pollfd() without using GMainContext.
Comment 2 Allison Karlitskaya (desrt) 2011-09-12 14:16:29 UTC
The deprecation of check/prepare funcs comes with the introduction of a function to set the monotonic time after which the source should be considered ready.  The solution here (as with idle sources) is just to set that to 'now'.
Comment 3 Philip Withnall 2017-10-24 11:34:15 UTC
This was fixed as bug #680121.

*** This bug has been marked as a duplicate of bug 680121 ***