Definition at line 33 of file StrictPolicyImpl.hh.
Public Member Functions | |||||||||||
StrictPolicyImpl (const char *name) | |||||||||||
Construct a StrictPolicyImpl object with the given values. | |||||||||||
virtual | ~StrictPolicyImpl () | ||||||||||
Deconstruct the policy. | |||||||||||
virtual char * | Name (void) throw (CORBA::SystemException) | ||||||||||
Mostly useful for debugging. | |||||||||||
virtual void | AddTask (Broker::Task_ptr new_task, const Broker::ScheduleParameters &sp) throw (CORBA::SystemException) | ||||||||||
NOTE: This method will be called before the reservation is made, giving the policy a chance to adjust any values.
| |||||||||||
virtual void | RemoveTask (Broker::Task_ptr added_task) throw (CORBA::SystemException) | ||||||||||
NOTE: This method will be called after the reservation has been destroyed, so it can safely reallocate the newly freed CPU time.
| |||||||||||
virtual Broker::TaskList * | GetTaskList (void) throw (CORBA::SystemException) | ||||||||||
| |||||||||||
virtual void | Activate (const Broker::TaskList &tasks) throw (CORBA::SystemException) | ||||||||||
NOTE: The policy is expected to discover and adjust the scheduling parameters of any currently executing tasks.
| |||||||||||
virtual void | Deactivate (void) throw (CORBA::SystemException) | ||||||||||
NOTE: The policy should change any scheduling parameters of the currently executing tasks, the next policy to be activated will handle any changes.
| |||||||||||
virtual void | ChangeTaskCPU (Broker::RealTimeTask_ptr task, CORBA::ULong ct, CORBA::ULong status, CORBA::ULong advice) throw (CORBA::SystemException, Broker::InvalidState) | ||||||||||
| |||||||||||
virtual CORBA::Float | GetMaxCPUAllocation (void) throw (CORBA::SystemException) | ||||||||||
| |||||||||||
virtual void | SetMaxCPUAllocation (CORBA::Float amount) throw (CORBA::SystemException) | ||||||||||
| |||||||||||
virtual void | SetTaskPriority (Broker::Task_ptr task, CORBA::Short priority) throw (CORBA::SystemException) | ||||||||||
| |||||||||||
virtual CORBA::Short | GetTaskPriority (Broker::Task_ptr task) throw (CORBA::SystemException) | ||||||||||
| |||||||||||
Static Public Attributes | |||||||||||
const float | DEFAULT_MAX_USED_CPU = 0.75 | ||||||||||
Maximum percentage of CPU to allocate to tasks. | |||||||||||
const float | DEFAULT_MIN_TASK_CPU = 0.02 | ||||||||||
Minimum percentage of CPU to allocate to a single task. | |||||||||||
Private Types | |||||||||||
enum | { TPB_STARVED } | ||||||||||
enum | { TPF_STARVED = (1L << TPB_STARVED) } | ||||||||||
Private Member Functions | |||||||||||
void | RepairTaskList (void) | ||||||||||
Repair the task list by removing any dead/unreachable objects. | |||||||||||
TaskPriority * | FindTaskPriority (Broker::RealTimeTask_ptr task) | ||||||||||
Find the TaskPriority node that corresponds to the given task. | |||||||||||
TaskPriority * | SubList (const RealTimeSchedule &rts, struct TaskPriority *ignore) | ||||||||||
Construct a list, ordered from lowest to highest priority, of the tasks whose schedule intersects with the given one. | |||||||||||
CORBA::ULong | TakeCPU (struct TaskPriority *sub_list, CORBA::ULong amount, struct TaskPriority *for_tp) | ||||||||||
Take CPU time from other tasks to give to another. | |||||||||||
CORBA::ULong | GiveCPU (struct TaskPriority *sub_list, CORBA::ULong amount, struct TaskPriority *for_tp) | ||||||||||
Give CPU time back to the other tasks. | |||||||||||
Private Attributes | |||||||||||
CORBA::String_var | sp_Name | ||||||||||
The name of this object as registered with the NamingService. | |||||||||||
float | sp_MaxUsedCPU | ||||||||||
The maximum percentage of CPU time that we are allowed to allocate. | |||||||||||
float | sp_MinTaskCPU | ||||||||||
The minimum percentage of CPU time that a task must have. | |||||||||||
lnList | sp_List | ||||||||||
A list of TaskPriority objects. | |||||||||||
CORBA::ULong | sp_MaxDeadline | ||||||||||
The largest deadline of the tasks managed by this policy. | |||||||||||
TaskPriority | sp_FauxTask | ||||||||||
Fake task object used to represent CPU time that is not reserved. |
|
Construct a StrictPolicyImpl object with the given values.
Definition at line 25 of file StrictPolicyImpl.cc. References DEFAULT_MAX_USED_CPU, DEFAULT_MIN_TASK_CPU, lnNode::ln_Pri, lnNewList(), require, sp_FauxTask, sp_MaxUsedCPU, sp_MinTaskCPU, StrictPolicyImpl::TaskPriority::tp_Link, and StrictPolicyImpl::TaskPriority::tp_Task. |
Here is the call graph for this function:
|
Find the TaskPriority node that corresponds to the given task.
Definition at line 699 of file StrictPolicyImpl.cc. References lnList::lh_Head, lnNode::ln_Succ, require, and sp_List. |
|
Give CPU time back to the other tasks.
Definition at line 512 of file StrictPolicyImpl.cc. References lnNode::ln_Pri, require, RealTimeSchedule::rts_Deadline, RealTimeSchedule::rts_Period, RealTimeSchedule::rts_Start, StrictPolicyImpl::TaskPriority::tp_Link, StrictPolicyImpl::TaskPriority::tp_Schedule, StrictPolicyImpl::TaskPriority::tp_SubLink, and StrictPolicyImpl::TaskPriority::tp_Task. Referenced by RepairTaskList(). |
|
Construct a list, ordered from lowest to highest priority, of the tasks whose schedule intersects with the given one.
Definition at line 261 of file StrictPolicyImpl.cc. References lnList::lh_Head, lnNode::ln_Succ, RealTimeSchedule::rts_Deadline, RealTimeSchedule::rts_Period, RealTimeSchedule::rts_Start, sp_FauxTask, sp_List, sp_MaxUsedCPU, StrictPolicyImpl::TaskPriority::tp_ComputeTime, StrictPolicyImpl::TaskPriority::tp_Schedule, StrictPolicyImpl::TaskPriority::tp_SubTime, and StrictPolicyImpl::TaskPriority::tp_Task. |
|
Take CPU time from other tasks to give to another.
Definition at line 308 of file StrictPolicyImpl.cc. References lnNode::ln_Pri, require, RealTimeSchedule::rts_Deadline, RealTimeSchedule::rts_Period, RealTimeSchedule::rts_Start, sp_MaxUsedCPU, sp_MinTaskCPU, StrictPolicyImpl::TaskPriority::tp_ComputeTime, StrictPolicyImpl::TaskPriority::tp_Flags, StrictPolicyImpl::TaskPriority::tp_Link, StrictPolicyImpl::TaskPriority::tp_Schedule, StrictPolicyImpl::TaskPriority::tp_SubLink, and StrictPolicyImpl::TaskPriority::tp_Task. |