FFRT
Overview
Function Flow Runtime (FFRT) is a software runtime library that works with the Function Flow programming model. It is used to schedule and execute tasks of an application developed on the Function Flow programming model.
System capability: SystemCapability.Resourceschedule.Ffrt.Core
Since: 10
Summary
Files
| Name | Description |
|---|---|
| condition_variable.h | Declares the condition variable interfaces in C. |
| loop.h | Declares the loop interfaces in C. |
| mutex.h | Declares the mutex interfaces in C. |
| queue.h | Declares the queue interfaces in C. |
| shared_mutex.h | Declares read-write lock interfaces in C. |
| sleep.h | Declares the sleep and yield interfaces in C. |
| task.h | Declares the task interfaces in C. |
| timer.h | Declares the timer interfaces in C. |
| type_def.h | Declares the common types. |
Structs
| Name | Description |
|---|---|
| struct ffrt_function_header_t | Describes a task execution function. |
| struct ffrt_dependence_t | Describes dependency data. |
| struct ffrt_deps_t | Describes dependencies. |
| struct ffrt_task_attr_t | Describes a task attribute. |
| struct ffrt_queue_attr_t | Describes a queue attribute. |
| struct ffrt_condattr_t | Describes a condition variable attribute. |
| struct ffrt_mutexattr_t | Describes a mutex attribute. |
| struct ffrt_rwlockattr_t | Describes a read-write lock attribute. |
| struct ffrt_mutex_t | Describes a mutex. |
| struct ffrt_rwlock_t | Describes a read-write lock. |
| struct ffrt_cond_t | Describes a condition variable. |
Types
| Name | Description |
|---|---|
| typedef void * ffrt_loop_t | Defines the handle to a loop. |
| typedef void * ffrt_queue_t | Defines the handle to a queue. |
| typedef int ffrt_qos_t | Defines the QoS type. |
| typedef void(* ffrt_function_t) (void *) | Defines the type of the pointer to a task execution function. |
| typedef void * ffrt_task_handle_t | Defines the handle to a task. |
| typedef void(* ffrt_poller_cb) (void *data, uint32_t event) | Defines the poller callback function. |
| typedef void(* ffrt_timer_cb) (void *data) | Defines the timer callback function. |
| typedef int ffrt_timer_t | Handle to the timer. |
Enums
| Name | Description |
|---|---|
| ffrt_queue_type_t { ffrt_queue_serial, ffrt_queue_concurrent, ffrt_queue_max } | Enumerates the queue types. |
| ffrt_queue_priority_t { ffrt_queue_priority_immediate = 0, ffrt_queue_priority_high, ffrt_queue_priority_low, ffrt_queue_priority_idle } | Enumerates the task priority types. |
| ffrt_qos_default_t { ffrt_qos_inherit = -1, ffrt_qos_background, ffrt_qos_utility, ffrt_qos_default, ffrt_qos_user_initiated } | Enumerates the task QoS types. |
| ffrt_storage_size_t { ffrt_task_attr_storage_size = 128, ffrt_auto_managed_function_storage_size = 64 + sizeof(ffrt_function_header_t), ffrt_mutex_storage_size = 64, ffrt_cond_storage_size = 64, ffrt_queue_attr_storage_size = 128, ffrt_rwlock_storage_size = 64 } | Enumerates the storage sizes available for different types |