Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

RKTask Class Reference

Collaboration diagram for RKTask:

Collaboration graph
[legend]
List of all members.

Detailed Description

An implementation of Broker::RealTimeTask for the TimeSys resource kernel.

The class will create an rk_resource_set for every process on construction and maintain it until destruction.

Definition at line 30 of file RKTask.hh.

Public Member Functions

 RKTask (const Broker::TaskParameters &tp) throw (CORBA::SystemException, Broker::DuplicateTaskParameter, Broker::InvalidTaskParameter, Broker::MissingTaskParameter)
 Construct an RKTask from the given parameters.
virtual ~RKTask ()
 Destruct an RKTask.
virtual char * Name (void) throw (CORBA::SystemException)
 Mostly useful for debugging.
virtual CORBA::ULong Period (void) throw (CORBA::SystemException)
 
virtual CORBA::ULong Deadline (void) throw (CORBA::SystemException)
 
virtual void SetManager (Broker::Manager_ptr man) throw (CORBA::SystemException)
 
Parameters:
man The manager this task was added to.

virtual void BeginCPUScheduling (const Broker::ScheduleParameters &cs) throw (CORBA::SystemException, Broker::DuplicateScheduleParameter, Broker::InvalidScheduleParameter, Broker::MissingScheduleParameter)
 
Parameters:
sp The high level scheduling parameters.
Exceptions:
DuplicateScheduleParameter if the given schedule has a duplicate parameter.
InvalidScheduleParameter if the given schedule has an invalid parameter.
MissingScheduleParameter if the given schedule is missing a required parameter.
CORBA::BAD_INV_ORDER if the method is called without intervening calls to EndCPUScheduling().

virtual void EndCPUScheduling (void) throw (CORBA::SystemException)
 
Exceptions:
CORBA::BAD_INV_ORDER if the method is called without BeginCPUScheduling() being called first.

virtual CORBA::ULong GetComputeTime (void) throw (CORBA::SystemException)
 
virtual void SetComputeTime (CORBA::ULong usecs) throw (CORBA::SystemException)
 
virtual void ReportCPU (Broker::RealTimeTask_ptr rtt, CORBA::ULong status, CORBA::ULong advice) throw (CORBA::SystemException)
 This method would then be used by adaptation proxies to change the advice parameter to their liking.

Parameters:
status The CPU usage of the task in microseconds.
advice The amount of CPU time, in microseconds, that the application would like for the next period.
krp Non-standard report parameters that are indexed by key name.
Returns:
The actual CPU reserve given to the task.
See also:
ChangeTaskCPU

virtual void ReportCPU2 (CORBA::ULong status, CORBA::ULong advice) throw (CORBA::SystemException)
 This method would then be used by adaptation proxies to change the advice parameter to their liking.

Parameters:
status The CPU usage of the task in microseconds.
advice The amount of CPU time, in microseconds, that the application would like for the next period.
krp Non-standard report parameters that are indexed by key name.
Returns:
The actual CPU reserve given to the task.
See also:
ChangeTaskCPU


Protected Attributes

CORBA::String_var rkt_Name
 The name of the task and the resource set created for it.
rk_resource_set_t rkt_ResourceSet
 The resource set for the process.
char rkt_OwnsResourceSet
 Flag used to indicate whether or not we allocated the resource set.
cpu_reserve_attr rkt_CPUReserveSpec
 Caches the value of the CPU reservation when scheduling is active and maintains the values when not active.
Broker::Manager_var rkt_Manager
 The Broker::Manager used to handle scheduling during contention.
rk_reserve_t rkt_CPUReserve
 The CPU reserve for the process.
timeval rkt_StartTime
 The time of day that this object was constructed.
timeval rkt_LastReservationLog
 The last time a reservation change was logged.
ofstream * rkt_ReservationLog
 The output stream for the reservation log file.


Constructor & Destructor Documentation

RKTask::RKTask const Broker::TaskParameters tp  )  throw (CORBA::SystemException, Broker::DuplicateTaskParameter, Broker::InvalidTaskParameter, Broker::MissingTaskParameter)
 

Construct an RKTask from the given parameters.

The current set of recognized parameters are:

  • name A string to be used as the name of the task. (required)
  • pid A long that contains the process ID to manage. (required)
Parameters:
tp The list of parameters.
Exceptions:
CORBA::SystemException for CORBA related errors.
Broker::InvalidTaskParameter if one of the parameters is invalid.
Broker::MissingTaskParameter if one of the required parameters is missing.

Definition at line 80 of file RKTask.cc.

References __XSTRING, microsec_to_timespec(), and RK_NAME_LEN.

Here is the call graph for this function:


Member Data Documentation

rk_reserve_t RKTask::rkt_CPUReserve [protected]
 

The CPU reserve for the process.

Only valid between BeginCPUScheduling and EndCPUScheduling calls.

Definition at line 148 of file RKTask.hh.

Referenced by EndCPUScheduling().

struct cpu_reserve_attr RKTask::rkt_CPUReserveSpec [protected]
 

Caches the value of the CPU reservation when scheduling is active and maintains the values when not active.

Invariant:
.compute_time <= .period

.deadline <= .period

Definition at line 136 of file RKTask.hh.

Broker::Manager_var RKTask::rkt_Manager [protected]
 

The Broker::Manager used to handle scheduling during contention.

Only valid between BeginCPUScheduling and EndCPUScheduling calls.

Definition at line 142 of file RKTask.hh.

CORBA::String_var RKTask::rkt_Name [protected]
 

The name of the task and the resource set created for it.

Invariant:
!= NULL

Definition at line 117 of file RKTask.hh.


The documentation for this class was generated from the following files:
Generated on Fri Oct 22 07:51:04 2004 for CPU Broker by  doxygen 1.3.9.1