|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.realtime.Scheduler
An instance of Scheduler
manages the execution of
schedulable objects and may implement a feasibility algorithm. The
feasibility algorithm may determine if the known set of schedulable
objects, given their particular exection ordering (or priority
assignment), is a feasible schedule. Subclasses of Scheduler
are used for alternative scheduling policies and should define an
instance()
class method to return the default
instance of the subclass. The name of the subclass should be
descriptive of the policy, allowing applications to deduce the
policy available for the scheduler obtained via
getDefaultScheduler()
(e.g., EDFScheduler
).
Field Summary | |
protected static javax.realtime.Scheduler |
defaultScheduler
|
private static long |
disabledThreads
|
private static long |
totalThreads
|
private static javax.realtime.VTMemory |
vt
|
Constructor Summary | |
protected |
Scheduler()
Create an instance of Scheduler . |
Method Summary | |
protected abstract void |
addThread(long threadID)
Used for adding a C thread that doesn't have any Java counterpart. |
protected abstract void |
addThread(javax.realtime.RealtimeThread thread)
Adds a thread to the thread list |
private void |
addThreadInC(javax.realtime.Schedulable t,
long threadID)
|
(package private) void |
addThreadToLists(javax.realtime.RealtimeThread thread)
|
protected abstract void |
addToFeasibility(javax.realtime.Schedulable schedulable)
Inform the scheduler and cooperating facilities that the resource demands (as expressed in the 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. |
private void |
addToRootSet()
|
static void |
atomic(java.lang.Runnable run)
Run the runnable in an atomic section |
private static int |
beginAtomic()
|
protected abstract long |
chooseThread(long currentTime)
Chooses a thread to run |
protected abstract void |
disableThread(long threadID)
Stop running threadID until enableThread -
used in the lock implementation to wait on a lock. |
protected abstract void |
enableThread(long threadID)
Enable threadID , allowing it run again - used in notify |
private static void |
endAtomic(int state)
|
abstract void |
fireSchedulable(javax.realtime.Schedulable schedulable)
Trigger the execution of a schedulable object (like an AsyncEventHandler . |
static javax.realtime.Scheduler |
getDefaultScheduler()
Gets a reference to the default scheduler. |
abstract java.lang.String |
getPolicyName()
Gets a string representing the policy of this . |
abstract boolean |
isFeasible()
Queries the system about the feasibility of the set of scheduling and release characteristics currently being considered. |
protected abstract boolean |
isFeasible(javax.realtime.Schedulable s,
javax.realtime.ReleaseParameters rp)
|
(package private) static void |
jAddCThread(long threadID)
|
protected long |
jChooseThread(long currentTime)
|
(package private) static void |
jDisableThread(javax.realtime.RealtimeThread rt,
long threadID)
|
(package private) static void |
jEnableThread(javax.realtime.RealtimeThread rt,
long threadID)
|
(package private) static long |
jNumThreads()
Return the total number of active threads in the system. |
(package private) static void |
jRemoveCThread(long threadID)
|
static void |
print()
Print out the status of the scheduler |
protected abstract void |
removeFromFeasibility(javax.realtime.Schedulable schedulable)
Inform the scheduler and cooperating facilities that the resource demands (as expressed in the associated instances of SchedulingParameters, ReleaseParameters, MemoryParameters
and ProcessingGroupParameters ) of this instance of
Schedulable should no longer be considered in the
feasibility analysis of the associated Scheduler
until further notice. |
protected abstract void |
removeThread(long threadID)
Used for removing a C thread that doesn't have any Java counterpart. |
protected abstract void |
removeThread(javax.realtime.RealtimeThread thread)
Removes a thread from the thread list |
(package private) void |
removeThreadFromLists(javax.realtime.RealtimeThread thread)
|
private long |
removeThreadInC(javax.realtime.Schedulable t)
|
static void |
setDefaultScheduler(javax.realtime.Scheduler scheduler)
Set the default scheduler. |
abstract boolean |
setIfFeasible(javax.realtime.Schedulable schedulable,
javax.realtime.ReleaseParameters release,
javax.realtime.MemoryParameters memory)
This method appears in many classes in the RTSJ and with various parameters. |
abstract boolean |
setIfFeasible(javax.realtime.Schedulable schedulable,
javax.realtime.ReleaseParameters release,
javax.realtime.MemoryParameters memory,
javax.realtime.ProcessingGroupParameters group)
This method appears in many classes in the RTSJ and with various parameters. |
protected void |
setQuanta(long microsecs)
Switch every microsecs microseconds |
protected abstract void |
waitForNextPeriod(javax.realtime.RealtimeThread rt)
Cause the thread to block until the next period |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static javax.realtime.Scheduler defaultScheduler
private static javax.realtime.VTMemory vt
private static long totalThreads
private static long disabledThreads
Constructor Detail |
protected Scheduler()
Scheduler
.
Method Detail |
protected abstract 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.
schedulable
- A reference to the given instance of Schedulable
.
public abstract void fireSchedulable(javax.realtime.Schedulable schedulable)
AsyncEventHandler
.
schedulable
- The Schedulable object to make active.public static javax.realtime.Scheduler getDefaultScheduler()
public abstract java.lang.String getPolicyName()
this
.
java.lang.String
object which is the name
of the scheduling polixy used by this
.public abstract boolean isFeasible()
protected abstract boolean isFeasible(javax.realtime.Schedulable s, javax.realtime.ReleaseParameters rp)
protected abstract void removeFromFeasibility(javax.realtime.Schedulable schedulable)
SchedulingParameters, ReleaseParameters, MemoryParameters
and ProcessingGroupParameters
) of this instance of
Schedulable
should no longer be considered in the
feasibility analysis of the associated Scheduler
until further notice. Whether the resulting system is feasible
or not, the subtraction is completed.
public static void setDefaultScheduler(javax.realtime.Scheduler scheduler)
RealtimeThread
when they are constructed. The default
scheduler is set to the required PriorityScheduler
at
startup.
scheduler
- The Scheduler
that becomes the default
scheduler assigned to new threads. If null nothing happens.public abstract 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 either this
or the given instance of
Schedulable
. If the resulting system is feasible the method
replaces the current sheduling characteristics, of either this
or the given instance of Schedulable
as appropriate, with the
new scheduling characteristics.
schedulable
- The instance of Schedulable
to which the
parameters will be assigned.release
- The proposed release parameters.memory
- The proposed memory parameters.
public abstract 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 either this
or the given instance of
Schedulable
. If the resulting system is feasible the method
replaces the current sheduling characteristics, of either this
or the given instance of Schedulable
as appropriate, with the
new scheduling characteristics.
schedulable
- The instance of Schedulable
to which the
parameters will be assigned.release
- The proposed release parameters.memory
- The proposed memory parameters.group
- The proposed processing group parameters.
protected abstract long chooseThread(long currentTime)
protected abstract void addThread(javax.realtime.RealtimeThread thread)
protected abstract void removeThread(javax.realtime.RealtimeThread thread)
protected abstract void addThread(long threadID)
protected abstract void removeThread(long threadID)
protected abstract void disableThread(long threadID)
threadID
until enableThread -
used in the lock implementation to wait on a lock.
protected abstract void enableThread(long threadID)
threadID
, allowing it run again - used in notify
protected abstract void waitForNextPeriod(javax.realtime.RealtimeThread rt)
protected final void setQuanta(long microsecs)
microsecs
microseconds
public static final void print()
public static final void atomic(java.lang.Runnable run)
private final void addToRootSet()
final void addThreadToLists(javax.realtime.RealtimeThread thread)
final void removeThreadFromLists(javax.realtime.RealtimeThread thread)
private final void addThreadInC(javax.realtime.Schedulable t, long threadID)
private final long removeThreadInC(javax.realtime.Schedulable t)
private static final int beginAtomic()
private static final void endAtomic(int state)
static final void jDisableThread(javax.realtime.RealtimeThread rt, long threadID)
static final void jEnableThread(javax.realtime.RealtimeThread rt, long threadID)
static final void jAddCThread(long threadID)
static final void jRemoveCThread(long threadID)
static final long jNumThreads()
protected final long jChooseThread(long currentTime)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |