alf_num_instances_set

NAME

alf_num_instances_set - Sets the maximum total number of parallel task instances ALF can have at one time.

SYNOPSIS

int alf_num_instances_set(alf_handle_t alf_handle, unsigned int number_of_instances);

Parameters  
alf_handle [IN] A handle to the ALF runtime code.
number_of_instances [IN] Specifies the maximum number of task instances that the caller wants to have. When this parameter is zero, the runtime allocates as many task instances as requested by the application programmer. However, the subsequent alf_ask_create call returns an error if ALF cannot accommodate the request.

DESCRIPTION

This function sets the maximum total number of parallel task instances ALF can have at one time. If number_of_instances is zero, there is no limit set by the application and ALF returns an error if it cannot accommodate a particular task creation request with a large number of instances.

Note: In SDK 3.0, this function is called once at the beginning after alf_init and before any alf_task_create. The ability to call this function twice to reset the number of instances is not supported. An ALF_ERR_PERM is returned in this situation.

RETURN VALUE

> 0 the actual number of instances provided by the ALF runtime.
less than 0 Errors occurred:
  • ALF_ERR_INVAL: Invalid input argument
  • ALF_ERR_BADF: Invalid ALF handle
  • ALF_ERR_PERM: The API call is not permitted at the current context
  • ALF_ERR_GENERIC: Generic internal errors
Related reference
alf_handle_t
alf_init
alf_query_system_info
alf_exit
alf_error_handler_register
ALF_ERR_POLICY_T