Main Page | Modules | Data Structures | File List | Data Fields | Globals

Hierarchical scheduling module


Functions

int fsf_init_local_scheduler (fsf_server_id_t server, fsf_sched_init_info_t info)
int fsf_set_contract_scheduling_policy (fsf_contract_parameters_t *contract, fsf_sched_policy_t sched_policy)
int fsf_get_contract_scheduling_policy (const fsf_contract_parameters_t *contract, fsf_sched_policy_t *sched_policy)
int fsf_create_local_thread (fsf_server_id_t server, fsf_sched_params_t *sched_params, pthread_t *thread, pthread_attr_t *attr, fsf_thread_code_t thread_code, void *arg)
int fsf_bind_local_thread_to_server (fsf_server_id_t server, pthread_t thread, fsf_sched_params_t *sched_params)
int fsf_set_local_thread_sched_parameters (pthread_t thread, const fsf_sched_params_t *sched_params)
int fsf_get_local_thread_sched_parameters (pthread_t thread, fsf_sched_params_t *sched_params)

Detailed Description

One of the application requirements that FSF addresses is the ability to compose different applications, possibly using different scheduling policies, into the same system. This can be addressed with support in the system for hierarchical scheduling. The lower level is the scheduler that takes care of the service contracts, using an unspecified scheduling policy (for instance, a CBS on top of EDF, or a sporadic server on top of fixed priorities). The top level is a scheduler running inside one particular FSF server, and scheduling the application threads with whatever scheduling policy they were designed. In this way, it is possible to have in the same system one application with, for example, fixed priorities, and another one running concurrently with an EDF scheduler.

We are currently providing three top-level schedulers: fixed priorities, EDF, and table-driven.


Function Documentation

int fsf_bind_local_thread_to_server fsf_server_id_t  server,
pthread_t  thread,
fsf_sched_params_t sched_params
 

This operation associates a thread with a server, which must have a policy different than FSF_NONE. The thread's local scheduling parameters are set to the value stored in the variable pointed to by sched_params, which must be compatible with the server's scheduling policy. After the call the thread starts consuming the server's budget and is executed according to the contract established for that server and to its scheduling policy. If the thread was already bound to another server, it is effectively unbound from it and bound to the specified one.

Implementation dependent issue: In order to allow the usage of application defined schedulers, the given thread must not have the scheduling policy SCHED_APP and at the same time be attached to an application scheduler different than the fsf scheduler.

Parameters:
[in] server server id
[in] thread thread id
[in] sched_params scheduling parameters for the thread
Return values:
0 if the operation is succesful
FSF_ERR_BAD_ARGUMENT if the server argument does not complain with the expected format or valid range, the given thread does not exist, or sched_params is NULL
FSF_ERR_SCHED_POLICY_NOT_COMPATIBLE if the scheduling policy in sched_params is not compatible to the server's one.
FSF_ERR_INTERNAL_ERROR erroneous binding or malfunction of the FSF main scheduler
FSF_ERR_UNKNOWN_APPSCHEDULED_THREAD if the thread is attached to an application defined scheduler different than the fsf scheduler
FSF_ERR_NOT_CONTRACTED_SERVER if the referenced server is not valid
FSF_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE: if the kind of workload of the server is FSF_OVERHEAD

int fsf_create_local_thread fsf_server_id_t  server,
fsf_sched_params_t sched_params,
pthread_t *  thread,
pthread_attr_t *  attr,
fsf_thread_code_t  thread_code,
void *  arg
 

This operation creates a thread and binds it to the specified server, which must have a policy different than FSF_NONE. The new thread is created with the arguments thread, attr, thread_code and arg as they are defined for the pthread_create() POSIX function call, and its local scheduling parameters are set to the value stored in the variable pointed to by sched_params, which must be compatible with the server's scheduling policy. Then, the function binds the created thread to the new server. The attr parameter is overwritten as necessary to introduce the adequate scheduling policy and priority, according to the preemption level given in the contract and the fsf_priority_map() function defined by the user.

Parameters:
[in] server server id
[in] sched_params scheduling parameters for the thread
[out] thread the thread id after creation
[in] attr attributes for the task (see pthread_create())
[in] thread_code pointer to a function that implements the thread code
[in] arg arguments for the thread
Return values:
0 if the operation is succesful
FSF_ERR_BAD_ARGUMENT if the value of the server argument is not in range, or sched_params is NULL
FSF_ERR_SCHED_POLICY_NOT_COMPATIBLE if the scheduling policy in sched_params is not compatible to the server's one.
FSF_ERR_INTERNAL_ERROR erroneous binding or malfunction of the FSF main scheduler
FSF_ERR_NOT_CONTRACTED_SERVER if the referenced server is not valid
others It may also return any of the errors that may be returned by the pthread_create()POSIX function call

int fsf_get_contract_scheduling_policy const fsf_contract_parameters_t contract,
fsf_sched_policy_t sched_policy
 

This operation obtains from the specified contract parameters object its scheduling policy, and copies it to the place pointed to by the corresponding input parameter.

Parameters:
[in] contract pointer to the contract
[out] sched_policy pointer to a variable that will contain the scheduling policy
Return values:
0 if the operation is succesful
FSF_ERR_BAD_ARGUMENT if sched_policy or contract are NULL

int fsf_get_local_thread_sched_parameters pthread_t  thread,
fsf_sched_params_t sched_params
 

This function stores the local scheduling parameters of the specified thread in the variable pointed to by sched_params

Parameters:
[in] thread thread id
[out] sched_params scheduling parameters
Return values:
0 if the operation is succesful
FSF_ERR_BAD_ARGUMENT if sched_params is NULL or the thread does not exist
FSF_ERR_NOT_SCHEDULED_THREAD if the given thread is not scheduled under the FSF

int fsf_init_local_scheduler fsf_server_id_t  server,
fsf_sched_init_info_t  info
 

This call has the following effects:

  • FP: none
  • EDF: none
  • TABLE_DRIVEN : Records the schedule duration, and starts the schedule at the time of the call. After the schedule duration has elapsed, the schedule in the table is repeated.

Parameters:
[in] server server id
[in] info TBD
Return values:
FSF_ERR_BAD_ARGUMENT if the value of the server argument is not in range or info is NULL
FSF_ERR_NOT_SCHEDULED_CALLING_THREAD if the calling thread is not scheduled under the FSF
FSF_ERR_INVALID_SCHEDULER_REPLY the scheduler is wrong or not running
FSF_ERR_NOT_CONTRACTED_SERVER if the server of the calling thread has been cancelled or it is not valid

int fsf_set_contract_scheduling_policy fsf_contract_parameters_t contract,
fsf_sched_policy_t  sched_policy
 

The operation updates the specified contract parameters object by setting its scheduling policy to the specified input parameter. The default policy is FSF_NONE, which means that only one thread may be bound to the server

Parameters:
[in] contract pointer to the contract
[in] sched_policy local scheduling policy for this server. Can be FSF_FP, FSF_EDF, FSF_TABLE_DRIVEN, FSF_NONE.
Return values:
0 if the operation is succesful
FSF_ERR_BAD_ARGUMENT if sched_policy is not one of the supported ones, or contract is NULL

int fsf_set_local_thread_sched_parameters pthread_t  thread,
const fsf_sched_params_t sched_params
 

This function changes the local scheduling parameters of the thread to the value pointed to by sched_params. This value must be compatible with the scheduling policy of the server to which the thread is bound.

Parameters:
[in] thread thread id
[in] sched_params scheduling parameters
Return values:
0 if the operation is succesful
FSF_ERR_BAD_ARGUMENT if the given thread does not exist, or sched_params is NULL
FSF_ERR_SCHED_POLICY_NOT_COMPATIBLE if the thread is already bound and the scheduling policy in sched_params is not compatible to the one of the thread's server.
FSF_ERR_NOT_SCHEDULED_THREAD if the given thread is not scheduled under the FSF
FSF_ERR_INTERNAL_ERROR erroneous binding or malfunction of the FSF main scheduler
FSF_ERR_UNKNOWN_APPSCHEDULED_THREAD if the thread is attached to an application defined scheduler different than the fsf scheduler
FSF_ERR_NOT_CONTRACTED_SERVER if the thread is bound and its server is not valid


Generated on Tue Apr 5 17:01:25 2005 for FSF by doxygen 1.3.4