On Mon, Sep 12, 2011 at 10:05 PM, Sinha, Ani <ani.si...@tellabs.com> wrote: > > On Sep 11, 2011, at 6:34 AM, Stefan Hajnoczi wrote: > >> >> You may find these posts I wrote helpful, they explain vcpu threads and >> the I/O thread: >> http://blog.vmsplice.net/2011/03/qemu-internals-big-picture-overview.html >> http://blog.vmsplice.net/2011/03/qemu-internals-overall-architecture-and.html >> > > > "One example user of worker threads is posix-aio-compat.c, an asynchronous > file I/O implementation. When core QEMU issues an aio request it is placed on > a queue. Worker threads take requests off the queue and execute them outside > of core QEMU. They may perform blocking operations since they execute in > their own threads and do not block > > Another example is ui/vnc-jobs-async.c which performs compute-intensive image > compression and encoding in worker threads." > > > I wonder why there isn't a general framework for this? Some thread that would > take requests off a queue and process them without knowing the internals of > the request.
There is, you can use GThreadPool. Stefan