|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.realtime.Scheduler | +--javax.realtime.PriorityScheduler
Class which represents the required (by RTSJ) priority-based scheduler. The default instance is the required priority scheduler which does fixed priority, preemptive scheduling.
Field Summary | |
(package private) static java.util.HashSet |
allThreads
|
static javax.realtime.RelativeTime |
defaultQuanta
|
(package private) static java.util.HashSet |
disabledThreads
|
(package private) static javax.realtime.PriorityScheduler |
instance
|
static long |
invocations
|
(package private) static javax.realtime.PeriodicParameters |
mainThreadParameters
|
(package private) static int |
MAX_PRIORITY
The maximum priority value used by the implementation. |
(package private) static int |
MIN_PRIORITY
The minimum priority value used by the implementation. |
static long |
missed
|
(package private) long |
nextThreadID
|
(package private) static int |
NORM_PRIORITY
|
(package private) static javax.realtime.PeriodicParameters |
noRTParameters
|
(package private) int |
nThreads
|
(package private) long |
runningThread
|
(package private) javax.realtime.RelativeTime |
runningTime
|
static long |
runningTimeMicros
|
(package private) static javax.realtime.ThreadConstraints[] |
thread
|
Fields inherited from class javax.realtime.Scheduler |
defaultScheduler |
Constructor Summary | |
protected |
PriorityScheduler()
Constructor for the required scheduler. |
Method Summary | |
void |
addThread(long threadID)
Used for adding a C thread that doesn't have any Java counterpart. |
void |
addThread(javax.realtime.RealtimeThread rt)
Adds a thread to the thread list |
protected void |
addThreadInC(javax.realtime.Schedulable t,
long threadID)
|
protected void |
addToFeasibility(javax.realtime.Schedulable schedulable)
Inform the scheduler and cooperating facilities that the resource demands, as expressed in associated instances of SchedulingParameters,
ReleaseParameters, MemoryParameters and ProcessingGroupParameters ,
of this instance of Schedulable will be considered in the
feasibility analysis of the associated Scheduler until
further notice. |
protected long |
chooseThread(long micros)
Implements EDF (Earliest Deadline First) Algorithm |
protected void |
disableThread(long threadID)
Stop running threadID until enableThread -
used in the lock implementation to wait on a lock. |
protected void |
enableThread(long threadID)
Enable threadID , allowing it run again - used in notify |
void |
fireSchedulable(javax.realtime.Schedulable schedulable)
Trigger the execution of a schedulable object (like an instance of AsyncEventHandler ). |
int |
getMaxPriority()
Gets the maximum priority available for a thread managed by this scheduler. |
static int |
getMaxPriority(java.lang.Thread thread)
Gets the maximum priority of the given instance of java.lang.Thread . |
int |
getMinPriority()
Gets the minimum priority available for a thread managed by this scheduler. |
static int |
getMinPriority(java.lang.Thread thread)
Gets the minimum priority of the given instance of java.lang.Thread . |
int |
getNormPriority()
Gets the normal priority available for a thread managed by this scheduler. |
static int |
getNormPriority(java.lang.Thread thread)
Gets the normal priority of the given instance of java.lang.Thread . |
java.lang.String |
getPolicyName()
Gets the policy name of this . |
static javax.realtime.PriorityScheduler |
instance()
Return a reference to an instance of PriorityScheduler . |
boolean |
isFeasible()
Queries the system about the feasibility of the set of Schedulable objects with respect to their include in the
feasibility set and the constraints expressed by their associated
parameter objects. |
protected boolean |
isFeasible(javax.realtime.Schedulable s,
javax.realtime.ReleaseParameters rp)
|
private float |
load(java.util.LinkedList releaseParams)
Determines the load on the system. |
protected void |
removeFromFeasibility(javax.realtime.Schedulable schedulable)
Inform this and cooperating facilities that the
ReleaseParameters of the ginve instance of Schedulable
should not be considered in feasibility analysis until further notified. |
void |
removeThread(long threadID)
Used for removing a C thread that doesn't have any Java counterpart. |
void |
removeThread(javax.realtime.RealtimeThread rt)
Removes a thread from the thread list |
boolean |
setIfFeasible(javax.realtime.Schedulable schedulable,
javax.realtime.ReleaseParameters release,
javax.realtime.MemoryParameters memory)
The method appears in many classe in the RTSJ and with various parameters. |
boolean |
setIfFeasible(javax.realtime.Schedulable schedulable,
javax.realtime.ReleaseParameters release,
javax.realtime.MemoryParameters memory,
javax.realtime.ProcessingGroupParameters group)
The method appears in many classe in the RTSJ and with various parameters. |
java.lang.String |
toString()
|
void |
waitForNextPeriod(javax.realtime.RealtimeThread rt)
Cause the thread to block until the next period |
Methods inherited from class javax.realtime.Scheduler |
addThreadToLists, atomic, getDefaultScheduler, jAddCThread, jChooseThread, jDisableThread, jEnableThread, jNumThreads, jRemoveCThread, print, removeThreadFromLists, setDefaultScheduler, setQuanta |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static final int MAX_PRIORITY
static final int MIN_PRIORITY
static final int NORM_PRIORITY
static java.util.HashSet allThreads
static java.util.HashSet disabledThreads
static javax.realtime.ThreadConstraints[] thread
public static javax.realtime.RelativeTime defaultQuanta
static javax.realtime.PeriodicParameters mainThreadParameters
static javax.realtime.PeriodicParameters noRTParameters
long nextThreadID
int nThreads
public static long missed
public static long invocations
public static long runningTimeMicros
long runningThread
javax.realtime.RelativeTime runningTime
static javax.realtime.PriorityScheduler instance
Constructor Detail |
protected PriorityScheduler()
Method Detail |
public static javax.realtime.PriorityScheduler instance()
PriorityScheduler
.
PriorityScheduler
.protected void addToFeasibility(javax.realtime.Schedulable schedulable)
SchedulingParameters,
ReleaseParameters, MemoryParameters
and ProcessingGroupParameters
,
of this instance of Schedulable
will be considered in the
feasibility analysis of the associated Scheduler
until
further notice. Whether the resulting system is feasible or not, the addition
is completed.
addToFeasibility
in class Scheduler
schedulable
- The instance of Schedulable
for which the
changes are proposed.
protected void addThreadInC(javax.realtime.Schedulable t, long threadID)
public void fireSchedulable(javax.realtime.Schedulable schedulable)
AsyncEventHandler
).
fireSchedulable
in class Scheduler
schedulable
- The Schedulable
object to make active.public int getMaxPriority()
public static int getMaxPriority(java.lang.Thread thread)
java.lang.Thread
. If the given thread is scheduled by the
required PriorityScheduler
the maximum priority of the
PriorityScheduler
is returned; otherwise
Thread.MAX_PRIORITY
is returned.
thread
- An instance of java.lang.Thread
. If null,
the maximum priority of the required
PriorityScheduler
is returned.
java.lang.Thread
.public int getMinPriority()
public static int getMinPriority(java.lang.Thread thread)
java.lang.Thread
. If the given thread is scheduled by the
required PriorityScheduler
the minimum priority of the
PriorityScheduler
is returned; otherwise
Thread.MIN_PRIORITY
is returned.
java.lang.Thread
.public int getNormPriority()
public static int getNormPriority(java.lang.Thread thread)
java.lang.Thread
. If the given thread is scheduled by the
required PriorityScheduler
the normal priority of the
PriorityScheduler
is returned; otherwise
Thread.NORM_PRIORITY
is returned.
public java.lang.String getPolicyName()
this
.
getPolicyName
in class Scheduler
private float load(java.util.LinkedList releaseParams)
releaseParams
- The list of the ReleaseParameters
to be considered when determining the load.
public boolean isFeasible()
Schedulable
objects with respect to their include in the
feasibility set and the constraints expressed by their associated
parameter objects.
isFeasible
in class Scheduler
Schedulable
currently in the feasibility set. False if the system cannot
satisfy those constraints.protected boolean isFeasible(javax.realtime.Schedulable s, javax.realtime.ReleaseParameters rp)
isFeasible
in class Scheduler
protected void removeFromFeasibility(javax.realtime.Schedulable schedulable)
this
and cooperating facilities that the
ReleaseParameters
of the ginve instance of Schedulable
should not be considered in feasibility analysis until further notified.
removeFromFeasibility
in class Scheduler
schedulable
- The instance of Schedulable
whose
ReleaseParameters
are to be removed from the
feasibility set.
public boolean setIfFeasible(javax.realtime.Schedulable schedulable, javax.realtime.ReleaseParameters release, javax.realtime.MemoryParameters memory)
Schedulable
or an instance of Schedulable
. The
method first performs a feasibility analysis using the new scheduling
characteristics of the given instance of Schedulable
. If the
resultingsystem is feasible the method replaces the current scheduling
characteristics, of either this
or the given instance of
Schedulable
as appropriate, with the new scheduling characteristics.
setIfFeasible
in class Scheduler
schedulable
- The instance of Schedulable
for which the
changes are proposedrelease
- The proposed release parameters.memory
- The proposed memory parameters.
public boolean setIfFeasible(javax.realtime.Schedulable schedulable, javax.realtime.ReleaseParameters release, javax.realtime.MemoryParameters memory, javax.realtime.ProcessingGroupParameters group)
Schedulable
or an instance of Schedulable
. The
method first performs a feasibility analysis using the new scheduling
characteristics of the given instance of Schedulable
. If the
resultingsystem is feasible the method replaces the current scheduling
characteristics, of either this
or the given instance of
Schedulable
as appropriate, with the new scheduling characteristics.
setIfFeasible
in class Scheduler
schedulable
- The instance of Schedulable
for which the
changes are proposedrelease
- The proposed release parameters.memory
- The proposed memory parameters.group
- The proposed processing group parameters.
protected long chooseThread(long micros)
chooseThread
in class Scheduler
protected void disableThread(long threadID)
Scheduler
threadID
until enableThread -
used in the lock implementation to wait on a lock.
disableThread
in class Scheduler
protected void enableThread(long threadID)
Scheduler
threadID
, allowing it run again - used in notify
enableThread
in class Scheduler
public void waitForNextPeriod(javax.realtime.RealtimeThread rt)
Scheduler
waitForNextPeriod
in class Scheduler
public void addThread(javax.realtime.RealtimeThread rt)
Scheduler
addThread
in class Scheduler
public void addThread(long threadID)
Scheduler
addThread
in class Scheduler
public void removeThread(javax.realtime.RealtimeThread rt)
Scheduler
removeThread
in class Scheduler
public void removeThread(long threadID)
Scheduler
removeThread
in class Scheduler
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |