On Thu, Nov 29, 2012 at 4:47 PM, Paolo Bonzini <pbonz...@redhat.com> wrote: > Stefan, perhaps you could replace the stop_notifier mechanism of > event-poll.c with something similar to aio_notify/qemu_notify_event, > and even remove event_poll_run in favor of event_poll (aka aio_wait...). > And also remove the return value from the callback, since your remaining > callbacks always return true. > > The main thread can just signal the event loop: > > s->stopping = true; > event_poll_notify(&s->event_poll); > qemu_thread_join(&s->thread); > > and the dataplane thread will drain the queue before exiting.
Thanks Michael and Paolo, this is a cool idea. I didn't see a way to communicate back that the data plane thread is quiesced without more locking. Stopping the thread is a neat solution. Stefan