[Spice-devel] [PATCH 5/7] red_worker: reimplement event loop using poll()

Dan McGee dpmcgee at gmail.com
Thu Feb 16 21:30:11 PST 2012


This removes the epoll dependency we had in red_worker, which was the
last Linux-specific call we were using in the entire Spice server. Given
we never have more than 10 file descriptors involved, there is little
performance gain had here by using epoll() over poll().

The biggest change is introduction of a new pre_disconnect callback;
this is because poll, unlike epoll, cannot automatically remove file
descriptors as they are closed from the pollfd set. This cannot be done
in the existing on_disconnect callback; that is too late as the stream
has already been closed and the file descriptor lost. The on_disconnect
callback can not be moved before the close and other operations easily
because of some behavior that relies on client_num being set to a
certain value.

Signed-off-by: Dan McGee <dpmcgee at gmail.com>
---

Notes:



More information about the Spice-devel mailing list