|cuflow_priority_t||cuflow_gworkq_set_static_priority (cuflow_priority_t pri)|
|cu_bool_t||cuflow_gworkq_yield_at (int priority)|
|cu_bool_t||cuflow_gworkq_yield_at_glck (int priority)|
|void||cuflow_gworkq_sched_at (cuflow_workq_fn_t fn, cuflow_priority_t priority)|
|void||cuflow_gworkq_sched (cuflow_workq_fn_t fn)|
|void||cuflow_gworkq_dump (FILE *out)|
The global work queue is a way for threads to co-operate to performed scheduled function calls in order of priority and in FIFO order within a given priority.
On SMP systems, this can be used to parallelise work by letting threads performing low-priority tasks help out the high-priority threads when work is available. The global work queue can also be useful on non-SMP systems to run tasks while waiting for resources to become available.
|#define cuflow_priority_background 3|
The priority of tasks which are to be run only when there is nothing else to do.
|#define cuflow_priority_interactive 10|
The priority of interacive tasks like GUI or curses dialogs.
|#define cuflow_priority_normal 7|
The priority of common tasks with no specific need.
|#define cuflow_priority_postmax 16|
One above the maximum priority.
|#define cuflow_priority_realtime 13|
The priority of realtime tasks like audio and video.
The current priority of the running thread.
|void cuflow_gworkq_dump||(||FILE *||out||)|
Debug dump of global work queues.
Schedule fn on the current thread's work queue. If a flexible-priority queue is active for the thread, it is used, otherwise a the static-priority queue at the same priority as the thread is used.
Schedule fn to be called at fixed priority.
Set the current static priority of the running thread and return its previous priority.
Yield the processor to tasks at or above priority in the global work queue and return true iff some work was done. The selected task is the first task of the highest priority non-empty queue.
Same as cuflow_gworkq_yieldall_prior, except that if no work was done, try also to run a single task at the current priority. Returns true iff some work was done. This is useful while waiting for resources.
Yield the processor to work above the current priority until there is no more such work. Returns true iff some work was done. This can be scattered at strategic points in low-priority code to give more CPUs to high priority tasks.
Yield the processor to work at or above the current priority until there is no more such work. Returns true iff some work was done.