GNOME Bugzilla – Bug 568438
gst_poll_wait calling read() on control socket
Last modified: 2009-01-26 11:55:33 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.
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.
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.