Re: [Qemu-devel] Re: [PATCH 3/3] vnc: threaded VNC server

2010-06-03 Thread Paolo Bonzini
> >> +void vnc_job_push(VncJob *job) > >> +{ > >> +    vnc_lock_queue(queue); > >> +    if (QLIST_EMPTY(&job->rectangles)) { > >> +        qemu_free(job); > > > > No need to lock if you get into the "then" block. > > I locked it because the main thread can try to push a job while a > consumer is r

Re: [Qemu-devel] Re: [PATCH 3/3] vnc: threaded VNC server

2010-06-03 Thread Corentin Chary
On Thu, Jun 3, 2010 at 9:55 AM, Paolo Bonzini wrote: > On 05/29/2010 09:38 AM, Corentin Chary wrote: >> >> Implement a threaded VNC server using the producer-consumer model. >> The main thread will push encoding jobs (a list a rectangles to update) >> in a queue, and the VNC worker thread will con