Statistics
| Branch: | Revision:

root / thread-pool.c @ f487b677

History | View | Annotate | Download (9.7 kB)

# Date Author Comment
c4d9d196 03/15/2013 05:07 pm Stefan Hajnoczi

threadpool: drop global thread pool

Now that each AioContext has a ThreadPool and the main loop AioContext
can be fetched with bdrv_get_aio_context(), we can eliminate the concept
of a global thread pool from thread-pool.c.

The submit functions must take a ThreadPool* argument....

b811203c 03/15/2013 05:07 pm Stefan Hajnoczi

threadpool: move globals into struct ThreadPool

Move global variables into a struct so multiple thread pools can be
supported in the future.

This patch does not change thread-pool.h interfaces. There is still a
global thread pool and it is not yet possible to create/destroy...

f7311ccc 03/15/2013 05:07 pm Stefan Hajnoczi

threadpool: add thread_pool_new() and thread_pool_free()

ThreadPool is tied to an AioContext through its event notifier, which
dictates in which AioContext the work item's callback function will be
invoked.

In order to support multiple AioContexts we need to support multiple...

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

737e150e 12/19/2012 09:31 am Paolo Bonzini

block: move include files to include/block/

Signed-off-by: Paolo Bonzini <>

d7331bed 11/14/2012 07:19 pm Stefan Hajnoczi

aio: rename AIOPool to AIOCBInfo

Now that AIOPool no longer keeps a freelist, it isn't really a "pool"
anymore. Rename it to AIOCBInfo and make it const since it no longer
needs to be modified.

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

19d092cf 10/31/2012 11:38 am Paolo Bonzini

threadpool: do not take lock in event_notifier_ready

The ordering is:

worker thread                         consumer thread
-------------------------------------------------------------------
write ret event_notifier_test_and_clear...
d354c7ec 10/31/2012 11:37 am Paolo Bonzini

aio: add generic thread-pool facility

Add a generic thread-pool. The code is roughly based on posix-aio-compat.c,
with some changes, especially the following:

- use QemuSemaphore instead of QemuCond;

- separate the state of the thread from the return code of the worker...