harmony 鸿蒙FFRT

2025-06-12 浏览 (1)

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

NameDescription
condition_variable.hDeclares the condition variable interfaces in C.
loop.hDeclares the loop interfaces in C.
mutex.hDeclares the mutex interfaces in C.
queue.hDeclares the queue interfaces in C.
shared_mutex.hDeclares read-write lock interfaces in C.
sleep.hDeclares the sleep and yield interfaces in C.
task.hDeclares the task interfaces in C.
timer.hDeclares the timer interfaces in C.
type_def.hDeclares the common types.

Structs

NameDescription
struct  ffrt_function_header_tDescribes a task execution function.
struct  ffrt_dependence_tDescribes dependency data.
struct  ffrt_deps_tDescribes dependencies.
struct  ffrt_task_attr_tDescribes a task attribute.
struct  ffrt_queue_attr_tDescribes a queue attribute.
struct  ffrt_condattr_tDescribes a condition variable attribute.
struct  ffrt_mutexattr_tDescribes a mutex attribute.
struct  ffrt_rwlockattr_tDescribes a read-write lock attribute.
struct  ffrt_mutex_tDescribes a mutex.
struct  ffrt_rwlock_tDescribes a read-write lock.
struct  ffrt_cond_tDescribes a condition variable.

Types

NameDescription
typedef void * ffrt_loop_tDefines the handle to a loop.
typedef void * ffrt_queue_tDefines the handle to a queue.
typedef int ffrt_qos_tDefines 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_tDefines 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_tHandle to the timer.

Enums

NameDescription
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