public class FirstInFirstOutScheduler extends PriorityScheduler
PriorityScheduler
where once a thread is scheduled
at a given priority, it runs until it is blocked or is preempted by a
higher priority thread. When preempted, it remains the next thread ready
for its priority. This is the default scheduler for realtime tasks.
It represents the required (by the RTSJ) priority-based scheduler.
The default instance is the base scheduler which does fixed priority,
preemptive scheduling.
This scheduler, like all schedulers, governs the default values for scheduling-related parameters in its client schedulables. The defaults are as follows:
Attribute |
Default Value |
---|---|
Priority | norm priority |
FirstInFirstOutScheduler
which is the system's base scheduler
and is returned by FirstInFirstOutScheduler.instance()
.
The instance returned by the instance()
method is the
base scheduler and is returned by
Scheduler.getDefaultScheduler()
unless the default scheduler
is reset with Scheduler.setDefaultScheduler(Scheduler)
.MAX_PRIORITY, MIN_PRIORITY
Modifier and Type | Method and Description |
---|---|
int |
getMaxPriority()
Obtains the maximum priority available for a schedulable
managed by this scheduler.
|
int |
getMinPriority()
Obtains the minimum priority available for a schedulable
managed by this scheduler.
|
int |
getNormPriority()
Obtains the normal priority available for a schedulable managed
by this scheduler.
|
java.lang.String |
getPolicyName()
Obtains the policy name of
this . |
static FirstInFirstOutScheduler |
instance()
Obtains a reference to the distinguished instance of
PriorityScheduler which is the system's base
scheduler. |
void |
reschedule(java.lang.Thread thread,
SchedulingParameters eligibility)
Promotes a
java.lang.Thread to realtime priority under this
scheduler. |
addToFeasibility, createDefaultSchedulingParameters, fireSchedulable, getMaxPriority, getMinPriority, getNormPriority, isFeasible, removeFromFeasibility, setIfFeasible, setIfFeasible, setIfFeasible
currentSchedulable, getDefaultScheduler, inSchedulableExecutionContext, setDefaultScheduler
public static FirstInFirstOutScheduler instance()
PriorityScheduler
which is the system's base
scheduler.PriorityScheduler
.public int getMaxPriority()
getMaxPriority
in class PriorityScheduler
public int getMinPriority()
getMinPriority
in class PriorityScheduler
public int getNormPriority()
getNormPriority
in class PriorityScheduler
public java.lang.String getPolicyName()
this
.getPolicyName
in class PriorityScheduler
public void reschedule(java.lang.Thread thread, SchedulingParameters eligibility)
Scheduler
java.lang.Thread
to realtime priority under this
scheduler. The affected thread will be scheduled as if it was a
RealtimeThread
with the given eligibility. This does not make
the affected thread a RealtimeThread
, however, and it will
not have access to facilities reserved for instances of
RealtimeThread
. Instances of RealtimeThread
will
be treated as if their scheduling parameters were set to
eligibility
.reschedule
in class PriorityScheduler
thread
- The thread to promote to realtime scheduling.eligibility
- A SchedulingParameters
instance such as
PriorityParameters
for a PriorityScheduler
.