|
Jamaica 6.1 release 1
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.aicas.jamaica.lang.Scheduler
public class Scheduler
Scheduler provides access to the Jamaica Scheduler.
| Field Summary | |
|---|---|
static int |
ALL_EVENTS_MASK
|
static int |
ALLOCATED_MEMORY
The current amount of allocated memory is (hi * 256 + lo) * 65K. |
static int |
ATOMIC_END
End atomic region Arguments |
static int |
ATOMIC_START
Start atomic region Arguments |
static int |
BLOCKED
State for thread that is BLOCKED |
static int |
CONTINUED
Ignore this entry, it is an entry that was combined with the previous one. |
static int |
CPU_SPEED
Indicate measured CPU speed. |
static int |
DEFAULT_MASK
|
static int |
DETACHABLE
State for thread that is RUNNING |
static int |
DETACHED
State for thread that is DETACHED |
static int |
ENTRY_ALLOCATED_MEMORY_HI
optional args for ALLOCATED_MEMORY |
static int |
ENTRY_ALLOCATED_MEMORY_LO
|
static int |
ENTRY_ARG1
|
static int |
ENTRY_ARG2
|
static int |
ENTRY_CPUSPEED_US_HIGH
|
static int |
ENTRY_CPUSPEED_US_LOW
optional args for CPU_SPEED: |
static int |
ENTRY_GC_PHASE
optional args for GC_PHASE |
static int |
ENTRY_KIND
Common entries in each recording: |
static int |
ENTRY_MONITOR_ID
|
static int |
ENTRY_MONITOR_OWNER
optional args for MONITOR_ENTER and MONITOR_EXIT: |
static int |
ENTRY_PRICHG_BASE_PRI
|
static int |
ENTRY_PRICHG_DYN_PRI
optional args for PRIORITY_CHANGE: |
static int |
ENTRY_RESREQ_RUNNING_THREAD
optional args for RESCHEDULE_REQUEST: |
static int |
ENTRY_RUNNING_ON_CPU_CPU
optional args for RUNNING_ON_CPU |
static int |
ENTRY_SIZE
Size of one recording entry, in number of bytes |
static int |
ENTRY_SLEEPING_THREAD
optional args for WAKEUP |
static int |
ENTRY_STATE_CHANGE_CAUSING_THREAD
|
static int |
ENTRY_STATE_CHANGE_NEW_STATE
optional args for STATE_CHANGE: |
static int |
ENTRY_THREAD
|
static int |
ENTRY_TIME
|
static int |
ENTRY_TIME_LOW
|
static int |
ENTRY_USER_KIND0
optional args for USER |
static int |
ENTRY_USER_KIND1
|
static int |
GC_PHASE
The GC phase change Arguments - GC phase: INIT 1 STOPPED 2 MARK 3 FINALIZE 4 MARK2 5 SWEEP 6 |
static int |
JAMAICA_BLOCK_DUE_TO_COST_OVERRUN
Predefined values for reason argument to block() and unblock(): block due to cost overrunt. |
static int |
JAMAICA_BLOCK_DUE_TO_JVMTI_SUSPEND
Predefined values for reason argument to block() and unblock(): block due to suspend request from JVMTI. |
static int |
JAMAICA_BLOCK_DUE_TO_JVMTI_WAIT_CONNECT
Predefined values for reason argument to block() and unblock(): block due to suspend request from JVMTI. |
static int |
JAMAICA_BLOCK_DUE_TO_MONITOR_ENTER
Predefined values for reason argument to block() and unblock(): block due to contention on monitor enter |
static int |
JAMAICA_BLOCK_DUE_TO_MONITOR_TIMED_WAIT
Predefined values for reason argument to block() and unblock(): block due to wait() called on a monitor. |
static int |
JAMAICA_BLOCK_DUE_TO_MONITOR_WAIT
Predefined values for reason argument to block() and unblock(): block due to wait() called on a monitor. |
static int |
JAMAICA_BLOCK_DUE_TO_STACK_INSPECTION
Predefined values for reason argument to block() and unblock(): block due to stack inspection from java.lang.Thread.nativegetStackTraceFor(). |
static int |
JAMAICA_BLOCK_DUE_TO_SUSPEND
Predefined values for reason argument to block() and unblock(): block due to Thread.suspend. |
static int |
JAMAICA_BLOCK_DUE_TO_UNSAFE_PARK
Predefined values for reason argument to block() and unblock(): block due to wait() called on a monitor. |
static int |
JAMAICA_BLOCK_DUE_TO_UNSAFE_TIMED_PARK
Predefined values for reason argument to block() and unblock(): block due to wait() called on a monitor. |
static int |
JAMAICA_BLOCK_DUE_TO_UNUSED
Predefined values for reason argument to block() and unblock(): block due to Thread.suspend. |
static int |
JAMAICA_BLOCK_DUE_TO_VM_INSPECTOR_WAIT_CONNECT
Predefined values for reason argument to block() and unblock(): block due to suspend request from VM monitor. |
static int |
JAMAICA_BLOCK_DUE_TO_VMCI_SUSPEND
Predefined values for reason argument to block() and unblock(): block due to suspend request from Virtual Machine Control Interface (VMCI). |
static int |
JAMAICA_BLOCK_DUE_TO_WAIT_FOR_FINALIZABLE
Predefined values for reason argument to block() and unblock(): block due to suspend request from JVMTI. |
static int |
JAMAICA_BLOCK_DUE_TO_WAIT_FOR_RESERVED_MEMORY
Predefined values for reason argument to block() and unblock(): block due to waiting for memory to be allocated by GC such that reserved memory is less than the maximum reserved memory. |
static int |
JAMAICA_BLOCK_REASONS_UNDEFINED
Set of blocking reason flags that are not predefined. |
static int |
MAX_EVENT_KIND
Maximum value of the event kind indicator. |
static int |
MAX_THREAD_STATE
The highest value for a thread state: |
static int |
MONITOR_CONTENDED
Tried to enter a contended monitor Arguments - id of thread that is owning the monitor - id of contended monitor |
static int |
MONITOR_DETAILED
This is an artificial kind, it is never written out. |
static int |
MONITOR_ENTER
Enter a monitor Arguments - id of monitor that is entered |
static int |
MONITOR_EXIT
Exit a monitor Arguments - id of monitor that is exited |
static int |
NORMAL_STATE_MASK
Mask for 'normal' thread states, i.e., all states except RESCHEDULING |
static int |
OVERFLOW
Indicate that the events buffer has overflown Arguments |
static int |
PRIORITY_CHANGE
Priority change of a thread Arguments - the new dynamic priority - the base priority of the thread |
static int |
READY
State for thread that is READY |
static int |
READY_YIELD
A ready thread performs yields the processor. |
static int |
REQUIRED_EVENTS_MASK
|
static int |
RESCHEDULE
A thread performed a reschedule Arguments: |
static int |
RESCHEDULE_REQUEST
A thread requests the running thread to reschedule Arguments: - thread id of running thread |
static int |
RESCHEDULING
State for thread that is RUNNING but needs to be RESCHEDULED |
static int |
RUNNING
State for thread that is RUNNING or DETACHABLE |
static int |
RUNNING_ON_CPU
The given thread is known to run on the given CPU Arguments - number of the CPU it is running on |
static int |
SET_NAME
Set name of a thread Arguments - the name ASCII characters |
static int |
SET_TIME
Set the time of the current entry Arguments - the high 32 bits of the time. |
static int |
SLEEPING
State for thread that is SLEEPING. |
static int |
START
Set the starting point of the recorded data. |
static int |
START_EXECUTION
Indicate that the running thread has obtained the CPU and now starts executing code. |
static int |
START_GC
Start GC work Arguments |
static int |
STATE_CHANGE
The state of a thread has changed. |
static int |
STOP_GC
Finish GC work Arguments |
static int |
SYNC
State value for thread state SYNC. |
static int |
TERMINATED
State for thread that is TERMINATED |
static int |
UNNORMAL_STATES_SHIFT
Bit position at which "unnormal" thread states start, i.e., RESCHEDULING which corresponds to the normal state RUNNING. |
static int |
USER
User event Arguments - the name ASCII characters |
static int |
WAKEUP
Wake up a sleeping blocked thread Arguments - id of thread that is woken up |
| Constructor Summary | |
|---|---|
Scheduler()
|
|
| Method Summary | |
|---|---|
static void |
allocateEventsBuffer(int size)
Start recording of scheduling events. |
static void |
main(String[] args)
main the main routine. |
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 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). |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CONTINUED
public static final int STATE_CHANGE
public static final int RESCHEDULE_REQUEST
public static final int RESCHEDULE
public static final int READY_YIELD
public static final int PRIORITY_CHANGE
public static final int CPU_SPEED
public static final int SET_NAME
public static final int MONITOR_ENTER
public static final int MONITOR_EXIT
public static final int WAKEUP
public static final int SET_TIME
public static final int START
public static final int START_GC
public static final int STOP_GC
public static final int START_EXECUTION
public static final int OVERFLOW
public static final int USER
public static final int MONITOR_CONTENDED
public static final int RUNNING_ON_CPU
public static final int ALLOCATED_MEMORY
public static final int GC_PHASE
public static final int ATOMIC_START
public static final int ATOMIC_END
public static final int MAX_EVENT_KIND
public static final int MONITOR_DETAILED
public static final int REQUIRED_EVENTS_MASK
public static final int DEFAULT_MASK
public static final int ALL_EVENTS_MASK
public static final int ENTRY_KIND
public static final int ENTRY_TIME
public static final int ENTRY_THREAD
public static final int ENTRY_ARG1
public static final int ENTRY_ARG2
public static final int ENTRY_TIME_LOW
public static final int ENTRY_STATE_CHANGE_NEW_STATE
public static final int ENTRY_STATE_CHANGE_CAUSING_THREAD
public static final int ENTRY_RESREQ_RUNNING_THREAD
public static final int ENTRY_PRICHG_DYN_PRI
public static final int ENTRY_PRICHG_BASE_PRI
public static final int ENTRY_CPUSPEED_US_LOW
public static final int ENTRY_CPUSPEED_US_HIGH
public static final int ENTRY_MONITOR_OWNER
public static final int ENTRY_MONITOR_ID
public static final int ENTRY_SLEEPING_THREAD
public static final int ENTRY_USER_KIND0
public static final int ENTRY_USER_KIND1
public static final int ENTRY_RUNNING_ON_CPU_CPU
public static final int ENTRY_ALLOCATED_MEMORY_HI
public static final int ENTRY_ALLOCATED_MEMORY_LO
public static final int ENTRY_GC_PHASE
public static final int ENTRY_SIZE
public static final int UNNORMAL_STATES_SHIFT
public static final int NORMAL_STATE_MASK
public static final int RUNNING
public static final int DETACHABLE
public static final int READY
public static final int BLOCKED
public static final int DETACHED
public static final int TERMINATED
public static final int SLEEPING
public static final int RESCHEDULING
public static final int SYNC
public static final int MAX_THREAD_STATE
public static final int JAMAICA_BLOCK_DUE_TO_UNUSED
public static final int JAMAICA_BLOCK_DUE_TO_SUSPEND
public static final int JAMAICA_BLOCK_DUE_TO_COST_OVERRUN
public static final int JAMAICA_BLOCK_DUE_TO_MONITOR_ENTER
public static final int JAMAICA_BLOCK_DUE_TO_MONITOR_WAIT
public static final int JAMAICA_BLOCK_DUE_TO_WAIT_FOR_FINALIZABLE
public static final int JAMAICA_BLOCK_DUE_TO_JVMTI_SUSPEND
public static final int JAMAICA_BLOCK_DUE_TO_JVMTI_WAIT_CONNECT
public static final int JAMAICA_BLOCK_DUE_TO_VM_INSPECTOR_WAIT_CONNECT
public static final int JAMAICA_BLOCK_DUE_TO_VMCI_SUSPEND
public static final int JAMAICA_BLOCK_DUE_TO_WAIT_FOR_RESERVED_MEMORY
public static final int JAMAICA_BLOCK_DUE_TO_MONITOR_TIMED_WAIT
public static final int JAMAICA_BLOCK_DUE_TO_UNSAFE_PARK
public static final int JAMAICA_BLOCK_DUE_TO_STACK_INSPECTION
public static final int JAMAICA_BLOCK_DUE_TO_UNSAFE_TIMED_PARK
public static final int JAMAICA_BLOCK_REASONS_UNDEFINED
| Constructor Detail |
|---|
public Scheduler()
| Method Detail |
|---|
public static void allocateEventsBuffer(int size)
public static void startRecording(int eventMask)
public static int stopRecording()
public static void writeResultsQuiet(String filename)
throws IOException
filename - the file to write
IOException - if writing failed.public 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)
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 waitOnSocket(int portNum,
boolean blocking)
public static void main(String[] args)
args - the arguments array, must be at least of length
1. args[0] is the main class name, args[1..args.length-1] are the
arguments to the main class' main() routine.
|
Jamaica 6.1 release 1
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||