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

2010-06-07 Thread Paolo Bonzini
On 06/06/2010 03:54 PM, Avi Kivity wrote: One option is to disable vnc on Windows and let a Windows maintainer materialize and add the corresponding support. Adding Windows support to qemu-threads must be done anyway sooner or later and most of the code can be found for example in git.

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

2010-06-06 Thread Avi Kivity
On 06/05/2010 11:03 AM, Corentin Chary wrote: So it's disabled by default? Sounds like a pretty cool and useful feature to me that should be enabled by default. Because it's does not work on windows (qemu-thread.c only uses pthread) and because I don't want to break everything :)

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

2010-06-06 Thread Corentin Chary
On Sun, Jun 6, 2010 at 3:54 PM, Avi Kivity a...@redhat.com wrote: On 06/05/2010 11:03 AM, Corentin Chary wrote: So it's disabled by default? Sounds like a pretty cool and useful feature to me that should be enabled by default. Because it's does not work on  windows (qemu-thread.c only uses

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

2010-06-05 Thread Corentin Chary
On Fri, Jun 4, 2010 at 3:44 PM, Alexander Graf ag...@suse.de wrote: On 04.06.2010, at 15:20, 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

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

2010-06-04 Thread Alexander Graf
On 04.06.2010, at 15:20, 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 consume that queue and send framebuffer updates to the output

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

2010-06-04 Thread Corentin Chary
On Fri, Jun 4, 2010 at 4:41 PM, Paolo Bonzini pbonz...@redhat.com wrote: +    vnc_lock_queue(queue); +    if (QTAILQ_EMPTY(queue-jobs)) { +        qemu_cond_wait(queue-cond,queue-mutex); +    } + +    /* If the queue is empty, it's an exit order */ +    if (QTAILQ_EMPTY(queue-jobs)) { +    

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

2010-06-04 Thread Alexander Graf
On 04.06.2010, at 15:20, 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 consume that queue and send framebuffer updates to the output

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

2010-06-04 Thread Corentin Chary
On Fri, Jun 4, 2010 at 3:25 PM, Alexander Graf ag...@suse.de wrote: On 04.06.2010, at 15:20, 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

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

2010-06-04 Thread Paolo Bonzini
+vnc_lock_queue(queue); +if (QTAILQ_EMPTY(queue-jobs)) { +qemu_cond_wait(queue-cond,queue-mutex); +} + +/* If the queue is empty, it's an exit order */ +if (QTAILQ_EMPTY(queue-jobs)) { +vnc_unlock_queue(queue); +return -1; +} + +job =

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

2010-06-04 Thread Paolo Bonzini
On 06/04/2010 04:55 PM, Corentin Chary wrote: Because it's not in a loop ? Like I said in the cover-letter (but this should probably be in a comment here) you can't use multiple worker on a single queue because of zlib streams. But if the issue is more a style issue than the actual