This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

1. AsyncWorker

1.1. About

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).

1.2. Technical about

1.2.1. `OAsyncWorker`

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.

1.2.2. `OAsyncWorkerTask`

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.

1.3. Documentation

1.5. Availability

1.5.1. Releases

1.5.2. Code

1.5.3. Building

From Subversion repository:

svn co http://svn.gnome.org/svn/asyncworker/trunk asyncworker
cd asyncworker
./autogen.sh --prefix=/opt/asyncworker
make && sudo make install

1.5.4. Using

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

2024-10-23 10:58