On Sun, Jun 6, 2010 at 4:11 PM, Avi Kivity <a...@redhat.com> wrote: > On 06/04/2010 04:20 PM, Corentin Chary wrote: >> >> + if (vnc_trylock_display(vd)) { >> + vd->timer_interval = VNC_REFRESH_INTERVAL_BASE; >> + qemu_mod_timer(vd->timer, qemu_get_clock(rt_clock) + >> + vd->timer_interval); >> + return; >> + } >> + >> has_dirty = vnc_refresh_server_surface(vd); >> + vnc_unlock_display(vd); >> > > This could delay the update by quite a bit, no?
Yep, but it's far better than waiting the lock because it doesn't slow down the main thread. I played big buck bunny trailler (33sec) in mplayer and tight encoding: - ~40 sec with the non-threaded server - ~37 sec with a lock - ~33 sec with a try_lock > A more elaborate approach would be to enqueue the refresh job into the > queue. May need the iothread enabled so we have qemu_mutex. Maybe, but I'd like to wait the generic async work subsystem before adding different kind of jobs to the queue. And it's already a big improvment over the current code :). > btw, I could not find other uses of vd->mutex, shouldn't it protect against > the work thread? Check vnc-jobs.c, there is a qemu_mutex_lock(vs->vd->mutex); -- Corentin Chary http://xf.iksaif.net