Rate This Document
Findability
Accuracy
Completeness
Readability

HTL_thread_scheduler_create_basic

Creates a basic scheduler.

Interface Definition

int int HTL_thread_scheduler_create_basic(HTL_thread_scheduler_type_t sched_type, int num_thread_pools, HTL_thread_pool_t *thread_pools, HTL_thread_scheduler_config_t sched_config, HTL_thread_scheduler_t *scheduler);

Description

HTL_thread_scheduler_create_basic() creates a basic scheduler defined by HTL through parameters sched_type and sched_config, and returns the scheduler handle through scheduler.

scheduler is associated with the thread_pools array. The array contains num_thread_pools HTL_thread_pool_t handles. If the i-th element of thread_pools is HTL_THREAD_POOL_NULL, a default FIFO pool with the default pool configuration is created and used as the i-th element.

Parameters

Parameter

Type

Description

Input/Output

sched_type

HTL_thread_scheduler_type_t

Scheduler type.

Input

num_thread_pools

int

Number of pools associated with this scheduler.

Input

thread_pools

HTL_thread_pool_t *

Pools associated with this scheduler.

Input

sched_config

HTL_thread_scheduler_config_t

Scheduler configuration used to create a scheduler.

Input

scheduler

HTL_thread_scheduler_t *

Address of the handle to the scheduler.

Output

Return Value

  • HTL_THREAD_SUCCESS: success.
  • Other values: failure. For details, see the error code descriptions.

Example

    HTL_thread_scheduler_t sched;
    ret = HTL_thread_scheduler_create_basic(HTL_THREAD_SCHEDULER_DEFAULT, 1, &pool,
                                            HTL_THREAD_SCHEDULER_CONFIG_NULL, &sched);