|
VSTGUI 4.10
Graphical User Interface Framework not only for VST plugins
|
Simple Task Concurrency API. More...
Functions | |
| const Queue & | mainQueue () |
| Get the main/UI serial queue. | |
| const Queue & | backgroundQueue () |
| Get the background concurrent queue. | |
| Queue | makeSerialQueue (const char *name) |
| Make a new serial queue. | |
| void | releaseSerialQueue (const Queue &queue) |
| Release a serial queue. | |
| void | schedule (const Queue &queue, Task &&task) |
| Schedule a task to be executed asynchronously on a queue. | |
| void | waitAllTasksExecuted (const Queue &queue) |
| Wait for all tasks in the queue to complete execution. | |
Simple Task Concurrency API.
The Task Concurrency API facilitates scheduling tasks for execution on background threads, either concurrently or sequentially. This API also enables the scheduling of tasks on the main thread from any other thread.
This API can be used while the VSTGUI library is initialized. Upon deinitialization, triggered by the mandatory exit() call, this API ensures that all scheduled tasks are completed prior to returning.
Please note that once a task has been dispatched, it cannot be canceled.
| const Queue & backgroundQueue | ( | ) |
Get the background concurrent queue.
Tasks scheduled on this queue are performed concurrently on background threads. The number of background threads depends on the system's CPU core count.
Can be called from any thread.
| const Queue & mainQueue | ( | ) |
Get the main/UI serial queue.
Tasks scheduled on this queue are performed sequentially on the main/ui thread.
Can be called from any thread.
| Queue makeSerialQueue | ( | const char * | name | ) |
Make a new serial queue.
Tasks scheduled on this queue are executed sequentially on a background thread.
The caller owns the queue, and needs to release the queue via the releaseSerialQueue() function.
Can be called from any thread.
| name | the name of the serial queue (optional) |
| void releaseSerialQueue | ( | const Queue & | queue | ) |
Release a serial queue.
This function will block until all tasks of the queue were executed.
Can be called from any thread.
| queue | the queue which to release |
| void schedule | ( | const Queue & | queue, |
| Task && | task ) |
Schedule a task to be executed asynchronously on a queue.
Can be called from any thread, but should not be called from realtime constraint threads as it may involves locks and memory allocations
| queue | on which queue to perform the task |
| task | task to be performed |
| void waitAllTasksExecuted | ( | const Queue & | queue | ) |
Wait for all tasks in the queue to complete execution.
Can only be called from the main thread.
| queue | on which queue to perform the task |