aicas logoJamaica 6.1 release 1

com.aicas.jamaica.lang
Class Scheduler

java.lang.Object
  extended by com.aicas.jamaica.lang.Scheduler

public class Scheduler
extends Object

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

CONTINUED

public static final int CONTINUED
Ignore this entry, it is an entry that was combined with the previous one.

See Also:
Constant Field Values

STATE_CHANGE

public static final int STATE_CHANGE
The state of a thread has changed. Arguments: - new state - blocking mask - thread id of thread causing the change

See Also:
Constant Field Values

RESCHEDULE_REQUEST

public static final int RESCHEDULE_REQUEST
A thread requests the running thread to reschedule Arguments: - thread id of running thread

See Also:
Constant Field Values

RESCHEDULE

public static final int RESCHEDULE
A thread performed a reschedule Arguments:

See Also:
Constant Field Values

READY_YIELD

public static final int READY_YIELD
A ready thread performs yields the processor. Arguments:

See Also:
Constant Field Values

PRIORITY_CHANGE

public static final int PRIORITY_CHANGE
Priority change of a thread Arguments - the new dynamic priority - the base priority of the thread

See Also:
Constant Field Values

CPU_SPEED

public static final int CPU_SPEED
Indicate measured CPU speed. Arguments - low word of ms passed during measurement - high word of ms passed during measurement

See Also:
Constant Field Values

SET_NAME

public static final int SET_NAME
Set name of a thread Arguments - the name ASCII characters

See Also:
Constant Field Values

MONITOR_ENTER

public static final int MONITOR_ENTER
Enter a monitor Arguments - id of monitor that is entered

See Also:
Constant Field Values

MONITOR_EXIT

public static final int MONITOR_EXIT
Exit a monitor Arguments - id of monitor that is exited

See Also:
Constant Field Values

WAKEUP

public static final int WAKEUP
Wake up a sleeping blocked thread Arguments - id of thread that is woken up

See Also:
Constant Field Values

SET_TIME

public static final int SET_TIME
Set the time of the current entry Arguments - the high 32 bits of the time.

See Also:
Constant Field Values

START

public static final int START
Set the starting point of the recorded data. Events before this point are only to set the correct state Arguments

See Also:
Constant Field Values

START_GC

public static final int START_GC
Start GC work Arguments

See Also:
Constant Field Values

STOP_GC

public static final int STOP_GC
Finish GC work Arguments

See Also:
Constant Field Values

START_EXECUTION

public static final int START_EXECUTION
Indicate that the running thread has obtained the CPU and now starts executing code. Arguments

See Also:
Constant Field Values

OVERFLOW

public static final int OVERFLOW
Indicate that the events buffer has overflown Arguments

See Also:
Constant Field Values

USER

public static final int USER
User event Arguments - the name ASCII characters

See Also:
Constant Field Values

MONITOR_CONTENDED

public static final int MONITOR_CONTENDED
Tried to enter a contended monitor Arguments - id of thread that is owning the monitor - id of contended monitor

See Also:
Constant Field Values

RUNNING_ON_CPU

public static final int RUNNING_ON_CPU
The given thread is known to run on the given CPU Arguments - number of the CPU it is running on

See Also:
Constant Field Values

ALLOCATED_MEMORY

public static final int ALLOCATED_MEMORY
The current amount of allocated memory is (hi * 256 + lo) * 65K. Arguments - allocated memory hi - allocated memory lo

See Also:
Constant Field Values

GC_PHASE

public static final int GC_PHASE
The GC phase change Arguments - GC phase: INIT 1 STOPPED 2 MARK 3 FINALIZE 4 MARK2 5 SWEEP 6

See Also:
Constant Field Values

ATOMIC_START

public static final int ATOMIC_START
Start atomic region Arguments

See Also:
Constant Field Values

ATOMIC_END

public static final int ATOMIC_END
End atomic region Arguments

See Also:
Constant Field Values

MAX_EVENT_KIND

public static final int MAX_EVENT_KIND
Maximum value of the event kind indicator.

See Also:
Constant Field Values

MONITOR_DETAILED

public static final int MONITOR_DETAILED
This is an artificial kind, it is never written out. If this is requested, then all MONITOR_ENTER and MONITOR_EXIT will be recorded (except in compiled code), otherwise only those monitor operations that affect several threads will be recorded and the MONITOR_ENTER records may be late. Arguments - id of thread that is woken up

See Also:
Constant Field Values

REQUIRED_EVENTS_MASK

public static final int REQUIRED_EVENTS_MASK
See Also:
Constant Field Values

DEFAULT_MASK

public static final int DEFAULT_MASK
See Also:
Constant Field Values

ALL_EVENTS_MASK

public static final int ALL_EVENTS_MASK
See Also:
Constant Field Values

ENTRY_KIND

public static final int ENTRY_KIND
Common entries in each recording:

See Also:
Constant Field Values

ENTRY_TIME

public static final int ENTRY_TIME
See Also:
Constant Field Values

ENTRY_THREAD

public static final int ENTRY_THREAD
See Also:
Constant Field Values

ENTRY_ARG1

public static final int ENTRY_ARG1
See Also:
Constant Field Values

ENTRY_ARG2

public static final int ENTRY_ARG2
See Also:
Constant Field Values

ENTRY_TIME_LOW

public static final int ENTRY_TIME_LOW
See Also:
Constant Field Values

ENTRY_STATE_CHANGE_NEW_STATE

public static final int ENTRY_STATE_CHANGE_NEW_STATE
optional args for STATE_CHANGE:

See Also:
Constant Field Values

ENTRY_STATE_CHANGE_CAUSING_THREAD

public static final int ENTRY_STATE_CHANGE_CAUSING_THREAD
See Also:
Constant Field Values

ENTRY_RESREQ_RUNNING_THREAD

public static final int ENTRY_RESREQ_RUNNING_THREAD
optional args for RESCHEDULE_REQUEST:

See Also:
Constant Field Values

ENTRY_PRICHG_DYN_PRI

public static final int ENTRY_PRICHG_DYN_PRI
optional args for PRIORITY_CHANGE:

See Also:
Constant Field Values

ENTRY_PRICHG_BASE_PRI

public static final int ENTRY_PRICHG_BASE_PRI
See Also:
Constant Field Values

ENTRY_CPUSPEED_US_LOW

public static final int ENTRY_CPUSPEED_US_LOW
optional args for CPU_SPEED:

See Also:
Constant Field Values

ENTRY_CPUSPEED_US_HIGH

public static final int ENTRY_CPUSPEED_US_HIGH
See Also:
Constant Field Values

ENTRY_MONITOR_OWNER

public static final int ENTRY_MONITOR_OWNER
optional args for MONITOR_ENTER and MONITOR_EXIT:

See Also:
Constant Field Values

ENTRY_MONITOR_ID

public static final int ENTRY_MONITOR_ID
See Also:
Constant Field Values

ENTRY_SLEEPING_THREAD

public static final int ENTRY_SLEEPING_THREAD
optional args for WAKEUP

See Also:
Constant Field Values

ENTRY_USER_KIND0

public static final int ENTRY_USER_KIND0
optional args for USER

See Also:
Constant Field Values

ENTRY_USER_KIND1

public static final int ENTRY_USER_KIND1
See Also:
Constant Field Values

ENTRY_RUNNING_ON_CPU_CPU

public static final int ENTRY_RUNNING_ON_CPU_CPU
optional args for RUNNING_ON_CPU

See Also:
Constant Field Values

ENTRY_ALLOCATED_MEMORY_HI

public static final int ENTRY_ALLOCATED_MEMORY_HI
optional args for ALLOCATED_MEMORY

See Also:
Constant Field Values

ENTRY_ALLOCATED_MEMORY_LO

public static final int ENTRY_ALLOCATED_MEMORY_LO
See Also:
Constant Field Values

ENTRY_GC_PHASE

public static final int ENTRY_GC_PHASE
optional args for GC_PHASE

See Also:
Constant Field Values

ENTRY_SIZE

public static final int ENTRY_SIZE
Size of one recording entry, in number of bytes

See Also:
Constant Field Values

UNNORMAL_STATES_SHIFT

public static final int UNNORMAL_STATES_SHIFT
Bit position at which "unnormal" thread states start, i.e., RESCHEDULING which corresponds to the normal state RUNNING.

See Also:
Constant Field Values

NORMAL_STATE_MASK

public static final int NORMAL_STATE_MASK
Mask for 'normal' thread states, i.e., all states except RESCHEDULING

See Also:
Constant Field Values

RUNNING

public static final int RUNNING
State for thread that is RUNNING or DETACHABLE

See Also:
Constant Field Values

DETACHABLE

public static final int DETACHABLE
State for thread that is RUNNING

See Also:
Constant Field Values

READY

public static final int READY
State for thread that is READY

See Also:
Constant Field Values

BLOCKED

public static final int BLOCKED
State for thread that is BLOCKED

See Also:
Constant Field Values

DETACHED

public static final int DETACHED
State for thread that is DETACHED

See Also:
Constant Field Values

TERMINATED

public static final int TERMINATED
State for thread that is TERMINATED

See Also:
Constant Field Values

SLEEPING

public static final int SLEEPING
State for thread that is SLEEPING. This state is used only for thread state displays in thread monitor to distinguish it from BLOCKED, which does not sleep immediately, and RUNNING, which may be SLEEPING while waiting for another CPU to sync.

See Also:
Constant Field Values

RESCHEDULING

public static final int RESCHEDULING
State for thread that is RUNNING but needs to be RESCHEDULED

See Also:
Constant Field Values

SYNC

public static final int SYNC
State value for thread state SYNC. A thread in state simple sync is RUNNING, but it has to execute a sync point as soon as possible.

See Also:
Constant Field Values

MAX_THREAD_STATE

public static final int MAX_THREAD_STATE
The highest value for a thread state:

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_UNUSED

public static final int JAMAICA_BLOCK_DUE_TO_UNUSED
Predefined values for reason argument to block() and unblock(): block due to Thread.suspend.

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_SUSPEND

public static final int JAMAICA_BLOCK_DUE_TO_SUSPEND
Predefined values for reason argument to block() and unblock(): block due to Thread.suspend.

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_COST_OVERRUN

public static final int JAMAICA_BLOCK_DUE_TO_COST_OVERRUN
Predefined values for reason argument to block() and unblock(): block due to cost overrunt.

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_MONITOR_ENTER

public static final int JAMAICA_BLOCK_DUE_TO_MONITOR_ENTER
Predefined values for reason argument to block() and unblock(): block due to contention on monitor enter

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_MONITOR_WAIT

public static final int JAMAICA_BLOCK_DUE_TO_MONITOR_WAIT
Predefined values for reason argument to block() and unblock(): block due to wait() called on a monitor.

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_WAIT_FOR_FINALIZABLE

public static final int JAMAICA_BLOCK_DUE_TO_WAIT_FOR_FINALIZABLE
Predefined values for reason argument to block() and unblock(): block due to suspend request from JVMTI.

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_JVMTI_SUSPEND

public static final int JAMAICA_BLOCK_DUE_TO_JVMTI_SUSPEND
Predefined values for reason argument to block() and unblock(): block due to suspend request from JVMTI.

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_JVMTI_WAIT_CONNECT

public static final int JAMAICA_BLOCK_DUE_TO_JVMTI_WAIT_CONNECT
Predefined values for reason argument to block() and unblock(): block due to suspend request from JVMTI.

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_VM_INSPECTOR_WAIT_CONNECT

public static final 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.

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_VMCI_SUSPEND

public static final 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).

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_WAIT_FOR_RESERVED_MEMORY

public static final 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.

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_MONITOR_TIMED_WAIT

public static final 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.

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_UNSAFE_PARK

public static final int JAMAICA_BLOCK_DUE_TO_UNSAFE_PARK
Predefined values for reason argument to block() and unblock(): block due to wait() called on a monitor.

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_STACK_INSPECTION

public static final 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().

See Also:
Constant Field Values

JAMAICA_BLOCK_DUE_TO_UNSAFE_TIMED_PARK

public static final 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.

See Also:
Constant Field Values

JAMAICA_BLOCK_REASONS_UNDEFINED

public static final int JAMAICA_BLOCK_REASONS_UNDEFINED
Set of blocking reason flags that are not predefined.

See Also:
Constant Field Values
Constructor Detail

Scheduler

public Scheduler()
Method Detail

allocateEventsBuffer

public static void allocateEventsBuffer(int size)
Start recording of scheduling events. If there is a recording in progress, reset the recording.


startRecording

public static void startRecording(int eventMask)
Start recording of scheduling events.


stopRecording

public static int stopRecording()
Stop recording of scheduling events.

Returns:
the number of integers recorded

writeResultsQuiet

public static void writeResultsQuiet(String filename)
                              throws IOException
Write recorded results to a file.

Parameters:
filename - the file to write
Throws:
IOException - if writing failed.

writeResults

public static void writeResults(String filename)
Write recorded results to a file. In case of an IOException, printStackTrace it to stderr.

Parameters:
filename - the file to write

recordUserEvent

public static void recordUserEvent(String message)
Record a user-defined event with the given message in color white

Parameters:
message - the event message, must be a 7-bit ASCII string.

recordUserEvent

public static void recordUserEvent(int kind,
                                   String message)
Record a user-defined event with the given message

Parameters:
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.

useStrictPriority

public 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). 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).

Parameters:
enabled - true to enable strict priorities for the current thread, false to disable strict priorities.

setMaxNonStrictPriority

public static int setMaxNonStrictPriority(int pri)
setMaxNonStrictPriority sets the maximum non-strict priority. Threads that have a Java priority that is less or equal to this priority will not use strict precedence, i.e., none of these threads will starve, even if a higher priority thread is always ready. Only if a thread with a priority higher than the maximum non-strict priority is ready to run, all threads with lower priority may starve.

Parameters:
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).
Returns:
the previous value for the maximum non strict priority.

setMaxIgnorePriority

public static int setMaxIgnorePriority(int pri)
setMaxIgnorePriority sets the maximum priority that is to be ignored by the scheduler. All Java threads with a priority less or equal to this priority will be treated equally.

Parameters:
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).
Returns:
the previous value for the maximum ignored priority.

microAdjustPriority

public 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).

Parameters:
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.
Returns:
the previous value for the priority micro adjustement.

microAdjustPriority

public 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). This call will have no effect if the given thread t has not been started yet or has died already.

Parameters:
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.
Returns:
the previous value for the priority micro adjustement. Result is Integer.MIN_VALUE in case t is not alive.

waitOnSocket

public static void waitOnSocket(int portNum,
                                boolean blocking)
Start the events recorder such that it waits for an events recorder connect at the given port.


main

public static void main(String[] args)
main the main routine.

Parameters:
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.

aicas logoJamaica 6.1 release 1

aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2012 aicas GmbH. All Rights Reserved.