Functions | |
int | fsf_init_shared_object (fsf_shared_obj_id_t obj_id, fsf_shared_obj_handle_t *obj_handle, pthread_mutex_t *mutex) |
int | fsf_get_shared_object_handle (fsf_shared_obj_id_t obj_id, fsf_shared_obj_handle_t *obj_handle) |
int | fsf_get_shared_object_mutex (fsf_shared_obj_handle_t obj_handle, pthread_mutex_t **mutex) |
int | fsf_set_contract_synchronization_parameters (fsf_contract_parameters_t *contract, const fsf_critical_sections_t *critical_sections) |
int | fsf_get_contract_synchronization_parameters (const fsf_contract_parameters_t *contract, fsf_critical_sections_t *critical_sections) |
The set of shared objects present in the system together with the lists of critical sections specified for each contract are used for schedulability analysis purposes only. A run-time mechanism for mutual exclusion is not provided in FSF for two important reasons. One of them is upward compatibility of previous code using regular primitives such as mutexes or protected objects (in Ada); this is a key issue if we want to persuade application developers to switch their systems to the FSF environment. The second reason is that enforcing worst case execution time for critical sections is expensive. The number of critical sections in real pieces of code may be very high, in the tens or in the hundreds per task, and monitoring all of them would require a large amount of system resources.
The FSF application does not depend on any particular synchronization protocol, but there is a requirement that a budget expiration cannot occur inside a critical section, because otherwise the blocking delays could be extremely large. This implies that the application is allowed to overrun its budget for the duration, at most, of the critical section, and this extra budget is taken into account in the schedulability analysis.
|
The operation obtains from the specified contract parameters object its critical sections, and copies them to the places pointed to by the specified input parameter. Only those critical_section_data records that are in use in the critical_sections structure are copied (according to its size field).
|
|
Getting the handle of shared objects. If the object already exists a handle to the object is returned in the variable pointed to by obj_handle. Otherwise, an error code is returned by the function.
|
|
Getting the mutex of shared objects. If the object exists, a pointer to its associated mutex is returned in the variable pointed to by mutex. Otherwise, an error code is returned by the function.
|
|
Initialization of shared objects. If the object identified by obj_id does not yet exist it is created, a handle to the object is returned in the variable pointed to by obj_handle, and the specified mutex is initialized with the appropriate attributes necessary for the current implementation. If the object already exists, the function fails.
|
|
The operation updates the specified contract parameters object by setting its critical sections to the specified input parameter.
|