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 568438 - gst_poll_wait calling read() on control socket
gst_poll_wait calling read() on control socket
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-01-20 15:16 UTC by Laurent Glayal
Modified: 2009-01-26 11:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Laurent Glayal 2009-01-20 15:16:43 UTC
When using udpsrc the gst_poll_wait() calls read() on control socket for each received packet even if no revent has been set by ppoll() on control socket. here is a typical trace :

...
[pid  6308] 13:33:45.372187 ppoll( <unfinished ...>
[pid  6308] 13:33:45.392412 <... ppoll resumed> [{fd=14, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=7, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLN
VAL, revents=POLLIN}], 2, {...}, NULL, 8) = 1 <0.020171>
[pid  6308] 13:33:45.392488 read(14, 0xb63a4db7, 1) = -1 EAGAIN (Resource temporarily unavailable) <0.000018>
...

Checking for ppoll revents may avoid unncecessary system call.
Comment 1 Wim Taymans 2009-01-20 16:07:16 UTC
Indeed. It requires some thinking though to fix that because the current semantics are that there should be no pending reads after the _wait() finishes.
Comment 2 Wim Taymans 2009-01-26 11:55:33 UTC
commit 0f55cf13b405dda0f30b151255daee5e52b667e1
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Mon Jan 26 12:52:12 2009 +0100

    Avoid unneeded reads from the control socket
    
    Add a new variable that keeps track of the status of the control socket. This
    allows us to avoid doing a read() on the control socket when we did not write
    anything to it.
    Fixes #568438.