public class Scheduler extends Object
| Constructor and Description |
|---|
Scheduler() |
| Modifier and Type | Method and Description |
|---|---|
static void |
allocateEventsBuffer(int size)
Start recording of scheduling events.
|
static int |
microAdjustPriority(int microAdjustment)
microAdjustPriority enables to slightly change the priority of
the current thread such that it will have precedence over other
threads with the same Java priority (+1) or other threads will
have priority over this thread (-1), or it will be treated
equally (0).
|
static int |
microAdjustPriority(Thread t,
int microAdjustment)
microAdjustPriority enables to slightly change the priority of a
running thread such that it will have precedence over other
threads with the same Java priority (+1) or other threads will
have priority over this thread (-1), or it will be treated
equally (0).
|
static void |
recordUserEvent(int kind,
String message)
Record a user-defined event with the given message
|
static void |
recordUserEvent(String message)
Record a user-defined event with the given message in color white
|
static void |
setLeastEligible(Thread t,
boolean b)
This method sets the attribute that indicates that this thread has least
eligibility to run.
|
static int |
setMaxIgnorePriority(int pri)
setMaxIgnorePriority sets the maximum priority that is to be
ignored by the scheduler.
|
static int |
setMaxNonStrictPriority(int pri)
setMaxNonStrictPriority sets the maximum non-strict priority.
|
static void |
startRecording(int eventMask)
Start recording of scheduling events.
|
static int |
stopRecording()
Stop recording of scheduling events.
|
static void |
useStrictPriority(boolean enabled)
useStrictPriority forces the scheduler to strictly enforce the
current thread's priority, i.e., if a higher priority thread is
ready this thread may starve completely even if its priority is
less or equal the maximum non-strict priority (see
setMaxNonStrictPriority(int)). |
static void |
waitOnSocket(int portNum,
boolean blocking)
Start the events recorder such that it waits for an events
recorder connect at the given port.
|
static void |
writeResults(String filename)
Write recorded results to a file.
|
static void |
writeResultsQuiet(String filename)
Write recorded results to a file.
|
public static void allocateEventsBuffer(int size)
public static void startRecording(int eventMask)
public static int stopRecording()
public static void writeResultsQuiet(String filename) throws IOException
IOException - if writing failed.filename - the file to writepublic static void writeResults(String filename)
filename - the file to writepublic static void recordUserEvent(String message)
message - the event message, must be a 7-bit ASCII string.public static void recordUserEvent(int kind,
String message)
kind - an id for this event's kind. This will be used to
distinguish different event kinds. Currently, only the lower 16
bits are stored and display tools may use this value modulo some
value (e.g. to select a color from a limited set of colors for
the display of the event kind).message - the event message, must be a 7-bit ASCII string.public static void useStrictPriority(boolean enabled)
setMaxNonStrictPriority(int)).
Enabling strict priority will enforce higher priority threads to
always have priority over this thread. However, if the current
thread's priority is less or equal to the maximum non-strict
priority, it does not prevent lower priority threads from
stealing the current thread's CPU.
A typical application of the strict priority would be a
low-priority service thread that should run without ever
disturbing the execution of any other higher-priority thread
(e.g., a low-priority garbage collection thread).enabled - true to enable strict priorities for the current
thread, false to disable strict priorities.public static int setMaxNonStrictPriority(int pri)
pri - the new maximum non-strict priority. -1 to keep the
maximum non-strict priority unchanged, 0 to disable non-strict
priorities, 10 to enable non-strict priorities for normal Java
threads only, javax.realtime.PriorityScheduler.getMaxPriority()
to enable non-strict priorities for all RTSJ threads (not
recommended since this will break the priority scheduling
required for realtime code).public static int setMaxIgnorePriority(int pri)
pri - the new maximum priority to be ignored. -1 to keep the
maximum ignored priority unchanged, 0 to disable ignoring
priorities, 10 to treat all normal Java threads equal,
javax.realtime.PriorityScheduler.getMaxPriority() to also treat
RTSJ threads equally (not recommended since this will break the
priority scheduling required for realtime code).public static int microAdjustPriority(int microAdjustment)
microAdjustment - the priority micro adjustment. +1 to
slightly increase the priority, -1 to decrease it and 0 to treat
this thread equal to other threads with the same Java priority.public static int microAdjustPriority(Thread t, int microAdjustment)
t - the thread whose priority micro-adjustment is to be
changed.microAdjustment - the priority micro adjustment. +1 to
slightly increase the priority, -1 to decrease it and 0 to treat
this thread equal to other threads with the same Java priority.public static void setLeastEligible(Thread t, boolean b)
This call has no effect if the given thread t has not been started yet or has died already.
t - the thread whose priority attribute 'leastEligible' is to
be setb - the new value of the thread attribute 'leastEligible' for tpublic static void waitOnSocket(int portNum,
boolean blocking)
aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2024 aicas GmbH. All Rights Reserved.