91,6 → 91,13 |
set its parameters. |
*/ |
/*@{*/ |
/** |
Contract parameters type; it is an opaque type (i.e. the internal |
structure of this data type is implementation dependent). The user |
can access and modify the parameters of a contract only with the |
proper functions, and should never access the data directly. |
*/ |
typedef FSF_CONTRACT_PARAMETERS_T_OPAQUE fsf_contract_parameters_t; |
|
/** |
The operation receives a pointer to a contract parameters object |
101,7 → 108,7 |
- the workload is unbounded (FSF_INDETERMINATE); |
- the server deadline is equal to the period; |
- the budget and deadline overrun are not notified; |
- the granularity is set to "continuous" (FSF_CONTINUOUS); |
- the granularity is set to "continuous"; |
- the quality and importance are set to the default values; |
- the scheduling policy is FSF_NONE. |
|
125,8 → 132,8 |
// |
// granularity => DEFAULT_GRANULARITY; |
// utilization_set; => size = 0 |
// quality => DEFAULT_QUALITY; (0, range 0..2**32-1) |
// importance => DEFAULT_IMPORTANCE; (1, range 1..5) |
// quality => DEFAULT_QUALITY; (range 0..100) |
// importance => DEFAULT_IMPORTANCE; (range 1..5) |
// |
// preemption_level => 0; (range 1..2**32-1) |
// critical_sections; => size = 0 |
133,11 → 140,8 |
|
// sched_policy => DEFAULT_SCHED_POLICY |
// (FSF_NONE) |
|
// network_id => FSF_NULL_NETWORK_ID; |
// (0) |
// granted_capacity_flag => false; |
|
|
/** |
The operation updates the specified contract parameters object by |
setting its budget, period, and workload to the specified input |
155,7 → 159,7 |
@retval 0 if the operation is succesful |
@retval FSF_ERR_BAD_ARGUMENT if any of the pointers is NULL |
or if only one of the timespec values is 0, and also if the workload |
is not a proper value (FSF_INDETERMINATE, FSF_BOUNDED or FSF_OVERHEAD) |
is not a proper value (FSF_INDETERMINATE or FSF_BOUNDED) |
*/ |
int |
fsf_set_contract_basic_parameters |
269,13 → 273,6 |
|
\defgroup core_synch Synchronization objects |
|
An abstract synchronization object is defined by the application. |
This object can be used by an application to wait for an event to |
arrive by invoking the fsf_schedule_triggered_job() operation. It |
can also be used to signal the event either causing a waiting |
server to wake up, or the event to be queued if no server is |
waiting for it. |
|
These objects are used to synchronize threads belonging to bounded |
workload servers. |
|
291,6 → 288,15 |
|
*/ |
/*@{*/ |
/** |
An abstract synchronization object is defined by the application. |
This object can be used by an application to wait for an event to |
arrive by invoking the fsf_schedule_triggered_job() operation. It |
can also be used to signal the event either causing a waiting |
server to wake up, or the event to be queued if no server is |
waiting for it. |
*/ |
typedef FSF_SYNCH_OBJ_HANDLE_T_OPAQUE fsf_synch_obj_handle_t; |
|
|
/** |
434,13 → 440,11 |
main scheduler |
@retval FSF_ERR_NOT_SCHEDULED_CALLING_THREAD if the calling thread is |
not scheduled under the FSF |
@retval FSF_ERR_NOT_BOUND if the calling thread does not have a valid |
@retval FSF_ERR_UNBOUND if the calling thread does not have a valid |
server bound to it |
@retval FSF_ERR_BAD_ARGUMENT if abs_time is NULL |
@retval FSF_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE if the kind of workload of |
the server is not FSF_BOUNDED |
@retval FSF_ERR_BAD_ARGUMENT if the workload of the server is not |
FSF_BOUNDED |
|
|
@sa fsf_schedule_triggered_job, fsf_timed_schedule_triggered_job |
*/ |
int |
503,8 → 507,7 |
taken. |
|
@retval 0 if the operation is succesful |
@retval FSF_ERR_INVALID_SYNCH_OBJ_HANDLE if the synch_handle is not valid |
@retval FSF_ERR_BAD_ARGUMENT if synch_handle is 0 |
@retval FSF_ERR_INVALID_SYNCH_OBJ_HANDLE if the handle is not valid |
@retval FSF_ERR_INVALID_SCHEDULER_REPLY the scheduler is wrong or not |
running |
@retval FSF_ERR_INTERNAL_ERROR erroneous binding or malfunction of |
511,10 → 514,10 |
the FSF main scheduler |
@retval FSF_ERR_NOT_SCHEDULED_CALLING_THREAD if the calling thread |
is not scheduled under the FSF |
@retval FSF_ERR_NOT_BOUND if the calling thread does not have |
@retval FSF_ERR_UNBOUND if the calling thread does not have |
a valid server bound to it |
@retval FSF_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE: if the kind of workload |
of the server is not FSF_BOUNDED |
@retval FSF_ERR_BAD_ARGUMENT if the workload of the server is not |
FSF_BOUNDED or the synch_handle given is not valid |
|
@sa fsf_schedule_triggered_job, fsf_schedule_timed_job |
|
533,7 → 536,6 |
absolute timeout. The timed_out argument, indicates whether the |
function returned because of a timeout or not |
|
@retval FSF_ERR_INVALID_SYNCH_OBJ_HANDLE if the synch_handle is not valid |
@retval FSF_ERR_INVALID_SCHEDULER_REPLY the scheduler is wrong or |
not running |
@retval FSF_ERR_INTERNAL_ERROR erroneous binding or malfunction |
540,12 → 542,11 |
of the FSF main scheduler |
@retval FSF_ERR_NOT_SCHEDULED_CALLING_THREAD if the calling thread is |
not scheduled under the FSF |
@retval FSF_ERR_NOT_BOUND if the calling thread does not have a valid |
@retval FSF_ERR_UNBOUND if the calling thread does not have a valid |
server bound to it |
@retval FSF_ERR_BAD_ARGUMENT if synch_handle is 0, or the abs_timeout |
argument is NULL, or its value is in the past |
@retval FSF_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE: if the kind of workload |
of the server is not FSF_BOUNDED |
@retval FSF_ERR_BAD_ARGUMENT if the workload of the server is not |
FSF_BOUNDED, the synch_handle given is not valid or the abs_timeout |
argument is NULL or its value is in the past |
|
@see fsf_schedule_triggered_job |
*/ |
576,7 → 577,18 |
*/ |
/*@{*/ |
|
/** |
Server Id type, that identifies a server created to manage a given |
contract |
*/ |
typedef int fsf_server_id_t; // => 0 |
|
/** |
The type references a function that may become a thread's |
code |
*/ |
typedef void * (*fsf_thread_code_t) (void *); |
|
/** |
The operation negotiates a contract for a new server. If the |
on-line admission test is enabled it determines whether the |
608,10 → 620,6 |
under the FSF |
@retval FSF_ERR_BAD_ARGUMENT if the contract or server arguments |
are NULL |
@retval FSF_ERR_TOO_MANY_SERVERS if there is no space for more servers |
(the maximum number of them is already |
reached) |
@retval FSF_ERR_CONTRACT_REJECTED if the contract is rejected |
*/ |
int |
fsf_negotiate_contract |
634,7 → 642,7 |
|
The server is created with the FSF_NONE scheduling policy, which |
means no hierarchical scheduling, and only one thread per server, |
except for the case of background tasks. |
except for the case of background tasks (see below) |
|
If the contract is rejected, the thread is not created and the |
corresponding error is returned. |
649,9 → 657,7 |
|
@retval FSF_ERR_BAD_ARGUMENT if the contract or server arguments are NULL |
@retval FSF_ERR_CONTRACT_REJECTED if the contract is rejected |
@retval FSF_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE if the kind of workload |
in the contract is FSF_OVERHEAD |
|
|
@retval others it may also return all the errors that may be returned |
by the pthread_create()POSIX function call |
|
674,7 → 680,7 |
|
The server is created with the FSF_NONE scheduling policy, which |
means no hierarchical scheduling, and only one thread per server, |
except for the case of background tasks. |
except for the case of background tasks (see below) |
|
Implementation dependent issue: In order to allow the usage of |
application defined schedulers, the calling thread must not have |
693,8 → 699,6 |
@retval FSF_ERR_BAD_ARGUMENT if the contract or server arguments |
are NULL |
@retval FSF_ERR_CONTRACT_REJECTED if the contract is rejected. |
@retval FSF_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE if the kind of workload |
in the contract is FSF_OVERHEAD |
*/ |
int |
fsf_negotiate_contract_for_myself |
727,10 → 731,8 |
expected format or valid range or the given thread does not exist |
@retval FSF_ERR_NOT_CONTRACTED_SERVER if the referenced server |
is not valid |
@retval FSF_ERR_ALREADY_BOUND if the given server has a thread |
already bound |
@retval FSF_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE if the kind of workload |
in the contract is FSF_OVERHEAD |
@retval FSF_ERR_ALREADY_BOUND if the thread is already bound to |
another server. |
|
*/ |
int |
779,7 → 781,7 |
@retval 0 if the operation is succesful |
@return FSF_ERR_NOT_SCHEDULED_THREAD if the given thread is not scheduled |
under the FSF |
@return FSF_ERR_NOT_BOUND if the given thread does not have a valid |
@return FSF_ERR_UNBOUND if the given thread does not have a valid |
server bound to it |
@return FSF_ERR_BAD_ARGUMENT if the given thread does not exist or the |
server argument is NULL |
857,7 → 859,6 |
running |
@retval FSF_ERR_NOT_CONTRACTED_SERVER if the server of the calling thread |
has been cancelled or it is not valid |
@retval FSF_ERR_REJECTED_CONTRACT if the renegotiation fails |
*/ |
int |
fsf_renegotiate_contract |
912,6 → 913,14 |
union sigval sig_value); |
|
/** |
Possible values returned by fsf_get_renegotiation_status |
*/ |
typedef enum {FSF_IN_PROGRESS, |
FSF_REJECTED, |
FSF_ADMITTED} |
fsf_renegotiation_status_t; |
|
/** |
The operation reports on the status of the last renegotiation |
operation enqueued for the specified server. It is callable even |
after notification of the completion of such operation, if |
936,11 → 945,21 |
fsf_renegotiation_status_t *renegotiation_status); |
|
|
//////////////////////////////////////////////////////////////////////// |
// CHANGE OF MODE: GROUPS OF CONTRACTS |
//////////////////////////////////////////////////////////////////////// |
//Data types |
|
/// List of contracts to negotiate |
typedef struct { |
int size; |
fsf_contract_parameters_t* contracts[FSF_MAX_N_SERVERS]; |
} fsf_contracts_group_t; |
|
/// List of servers to cancel |
typedef struct { |
int size; |
fsf_server_id_t servers[FSF_MAX_N_SERVERS]; |
} fsf_servers_group_t; |
|
|
/** |
This operation analizes the schedulability of the context that |
results from negitiating the contracts specified in the |