Provides a simple interface for running jobs in multiple threads at once. More...
#include "qev.h"Go to the source code of this file.
Functions | |
| void | qev_job (qev_data_cb cb, void **data, guint datac) |
| Runs the given jobs in the pool, only returning once all jobs have completed. More... | |
| void * | qev_job_async (qev_data_cb cb, void **data, guint datac, gboolean joinable) |
| Asynchronously runs the job in the pool. More... | |
| void | qev_job_async_join (void *job) |
| Wait for the async job to complete. More... | |
Provides a simple interface for running jobs in multiple threads at once.
Each thread that runs a job has access to QEV's thread-local resources.
| void qev_job | ( | qev_data_cb | cb, |
| void ** | data, | ||
| guint | datac | ||
| ) |
Runs the given jobs in the pool, only returning once all jobs have completed.
| cb | The callback to run from each thread |
| data | The data to be passed to the threads. Each pointer, 1...N, will be passed to its respective thread. [transfer-none] |
| datac | The number of data elements that need to be worked on |
| void* qev_job_async | ( | qev_data_cb | cb, |
| void ** | data, | ||
| guint | datac, | ||
| gboolean | joinable | ||
| ) |
Asynchronously runs the job in the pool.
| cb | The callback to run from each thread |
| data | The data to be passed to the threads. Each pointer, 1...N, will be passed to its respective thread. [transfer-none] |
| datac | The number of data elements that need to be worked on |
| joinable | If you wish to be able to wait for the job to finish |
joinable, then this is the pointer to pass to qev_job_async_join() to wait for the job to complete (if a job is joinable and you don't call _qev_job_async_join(), that's a memory leak). [transfer-full] | void qev_job_async_join | ( | void * | job | ) |
Wait for the async job to complete.
| job | The job that needs to complete. |
1.8.6