javax.realtime
Class ProcessingGroupParameters
java.lang.Object
javax.realtime.ProcessingGroupParameters
- public class ProcessingGroupParameters
- extends java.lang.Object
This is associated with one or more schedulable objects for which the system guarantees
that the associated objects will not be given more time per period than indicated by cost.
On implementations which do not support processing group parameters, this class may be
used as a hint to the feasibility algorithm. The motivation for this class is to allow
the execution demands of one or more aperiodic schedulable objects to be bound so that
they can be included in feasibility analysis. However, periodic or sporadic schedulable
objects can also be associated with a processing group.
For all schedulable objects with a reference to an instance of
PhysicalMemoryTypeFilter
p
no more than p.cost
will be allocated to the execution of
these schedulable objects in
each interval of time given by p.period
after the time indicated by
p.start
. Logically a
virtual server is associated with each instance of
ProcessingGroupParameters
.
This server
has a start time, a period, a cost (budget) and a deadline. The server can only logically
execute when (a) it has not consumed more execution time in its current release than the
cost (budget) parameter, (b) one of its associated schedulable objects is executable and
is the most eligible of the executable schedulable objects. If the server is logically
executable, the associated schedulable object is executed. When the cost has been consumed,
any overrunHandler is released, and the server is not eligible for logical execution until
its next period is due. At this point, its allocated cost (budget) is replenished. If the
server is logically executing when its deadline expires, any associated missHandler is
released. The deadline and cost parameters of all the associated schedulable objects have
the same impact as they would if the objects were not bound to a processing group.
Processing group parameters use
HighResolutionTime
values for cost, deadline, period and
start time. Since those times are expressed as a
HighResolutionTime
, the values use accurate
timers with nanosecond granularity. The actual resolution available and even the quantity
it measures depends on the clock associated with each time value.
When a reference to a
ProcessingGroupParameters
object is given as a parameter to a
schedulable object's constructor or passed as an argument to one of the schedulable object's
setter methods, the
ProcessingGroupParameters
object becomes the processing group parameters
object bound to that schedulable object. Changes to the values in the
ProcessingGroupParameters
object affect that schedulable object. If bound to more than one
schedulable object then changes to the values in the
ProcessingGroupParameters
object affect
all of the associated objects. Note that this is a one-to-many relationship and not a
many-to-many.
The implementation must use modified copy semantics for each HighResolutionTime parameter
value. The value of each time object should be treated as if it were copied at the time
it is passed to the parameter object, but the object reference must also be retained.
Only changes to a
ProcessingGroupParameters
object caused by methods on that object are
immediately visible to the scheduler. For instance, invoking setPeriod()
on a
ProcessingGroupParameters
object will make the change, then notify that the scheduler
that the parameter object has changed. At that point the scheduler's view of the processing
group parameters object is updated. Invoking a method on the RelativeTime object that is
the period for this object may change the period but it does not pass the change to the
scheduler at that time. That new value for period must not change the behavior of the SOs
that use the parameter object until a setter method on the
ProcessingGroupParameters
object
is invoked, or the parameter object is used in setProcessingGroupParameters()
or a
constructor for an SO.
The implementation may use copy semantics for each
HighResolutionTime
parameter value.
For instance the value returned by getCost()
must be equal to the value passed in by
setCost
, but it need not be the same object.
Caution: This class is explicitly unsafe in multithreaded situations when it is
being changed. No synchronization is done. It is assumed that users of this class who are
mutating instances will be doing their own synchronization at a higher level.
Caution: The cost parameter time should be considered to be measured against the
target platform.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
start
protected HighResolutionTime start
period
protected HighResolutionTime period
cost
protected RelativeTime cost
deadline
protected RelativeTime deadline
overrunHandler
protected AsyncEventHandler overrunHandler
missHandler
protected AsyncEventHandler missHandler
ProcessingGroupParameters
public ProcessingGroupParameters(HighResolutionTime start,
HighResolutionTime period,
RelativeTime cost,
RelativeTime deadline,
AsyncEventHandler overrunHandler,
AsyncEventHandler missHandler)
- Constructor.
- Parameters:
start
- period
- cost
- deadline
- overrunHandler
- missHandler
-
getCost
public RelativeTime getCost()
- Returns:
- the cost of this
getCostOverrunHandler
public AsyncEventHandler getCostOverrunHandler()
- Returns:
- the cost overrun handler of this
getDeadline
public RelativeTime getDeadline()
- Returns:
- the deadline of this
getDeadlineMissHandler
public AsyncEventHandler getDeadlineMissHandler()
- Returns:
- the deadline miss handler of this
getPeriod
public HighResolutionTime getPeriod()
- Returns:
- the period of this
getStart
public HighResolutionTime getStart()
- Returns:
- the start time of this
setCost
public void setCost(RelativeTime cost)
- Parameters:
cost
-
setCostOverrunHandler
public void setCostOverrunHandler(AsyncEventHandler overrunHandler)
- Parameters:
overrunHandler
-
setDeadline
public void setDeadline(RelativeTime deadline)
- Parameters:
deadline
-
setDeadlineMissHandler
public void setDeadlineMissHandler(AsyncEventHandler missHandler)
- Parameters:
missHandler
-
setIfFeasible
public boolean setIfFeasible(RelativeTime period,
RelativeTime cost,
RelativeTime deadline)
- Not currently implemented
- Parameters:
period
- cost
- deadline
-
- Returns:
- true if the resulting system is feasible
setPeriod
public void setPeriod(RelativeTime period)
- Parameters:
period
-
setStart
public void setStart(HighResolutionTime start)
- Parameters:
start
-