AsyncWorker is a little library written by PhilipVanHoof. The library makes it easier to provide a queue that automatically creates a worker thread that processes tasks that you assign to it. It processes them synchronously in that thread (one by one).
The OAsyncWorker is the queue itself. It launches a thread if it has work to do. For each tasks that it got assigned to process it first launches the task's body function and then the task's callback in the GMainLoop.
The OAsyncWorkerTask is one task that is usually assigned to a OAsyncWorker worker queue. It has a body function and a callback. The body function's code is executed in the queue's thread. The callback is executed in the GMainLoop.
- There are no official releases yet
From Subversion repository:
svn co http://svn.gnome.org/svn/asyncworker/trunk asyncworker cd asyncworker ./autogen.sh --prefix=/opt/asyncworker make && sudo make install
For example with the sample at DBusGlibBindings:
cd .. tar zxvf program-asyncw.tar.gz cd program-asyncw export PKG_CONFIG_PATH=/opt/asyncworker/lib/pkgconfig ./autogen.sh --prefix=/opt/program-asyncw make && sudo make install