[Spice-devel] [RFC v4 51/62] server/red_worker: get_streams_timeout: go over all clients
Marc-André Lureau
marcandre.lureau at gmail.com
Mon May 2 16:54:24 PDT 2011
Are we scheduling each client stream independently?
Also, I never looked at this code before, but my quick understanding
is that we are trying to schedule sending frame on the server side,
although the guest and the client already schedule the frame
themselves. So what the heck are we really doing here?
On Tue, Apr 26, 2011 at 12:55 PM, Alon Levy <alevy at redhat.com> wrote:
> ---
> server/red_worker.c | 16 ++++++++++++++--
> 1 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/server/red_worker.c b/server/red_worker.c
> index fe21a4c..7e022f6 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -2476,7 +2476,7 @@ static void red_streams_update_clip(RedWorker *worker, Surfaces *surfaces, Drawa
> }
> }
>
> -static inline unsigned int red_get_streams_timout(Surfaces *surfaces)
> +static inline unsigned int __red_get_streams_timout(Surfaces *surfaces)
> {
> unsigned int timout = -1;
> Ring *ring = &surfaces->streams;
> @@ -2499,6 +2499,18 @@ static inline unsigned int red_get_streams_timout(Surfaces *surfaces)
> return timout;
> }
>
> +static inline unsigned int red_get_streams_timout(RedWorker *worker)
> +{
> + Surfaces *surfaces;
> + RingItem *link;
> + unsigned int timeout = ~0;
> +
> + SURFACES_FOREACH(link, surfaces, worker) {
> + timeout = MIN(timeout, __red_get_streams_timout(surfaces));
> + }
> + return timeout;
> +}
> +
> static inline void red_handle_streams_timout(RedWorker *worker, Surfaces *surfaces)
> {
> Ring *ring = &surfaces->streams;
> @@ -10772,7 +10784,7 @@ void *red_worker_main(void *arg)
> struct epoll_event *event;
> struct epoll_event *end;
>
> - worker.epoll_timeout = MIN(red_get_streams_timout(&worker.surfaces), worker.epoll_timeout);
> + worker.epoll_timeout = MIN(red_get_streams_timout(&worker), worker.epoll_timeout);
> num_events = epoll_wait(worker.epoll, events, MAX_EPOLL_SOURCES, worker.epoll_timeout);
> red_handle_streams_timout(&worker, &worker.surfaces);
>
> --
> 1.7.4.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>
--
Marc-André Lureau
More information about the Spice-devel
mailing list