|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jikesrvm.scheduler.RVMThread
org.jikesrvm.scheduler.greenthreads.GreenThread
public class GreenThread
A green thread's Java execution context
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jikesrvm.scheduler.RVMThread |
|---|
RVMThread.State |
| Field Summary | |
|---|---|
int |
chosenProcessorId
ID of processor to run this thread (cycles for load balance) |
private GreenThread |
next
This thread's successor on a queue. |
private boolean |
osrParkingPermit
Parking permit for OSR. |
private static ProcessorLock |
osrParkLock
Lock used for handling parking and unparking for OSR. |
GreenProcessor |
processorAffinity
Virtual processor that this thread wants to run on (null --> any processor is ok). |
private int |
suspendPending
Should this thread be suspended the next time it is considered for scheduling? |
private static Offset |
suspendPendingOffset
Offset of the lock field controlling the suspending of a thread |
ThreadProxy |
threadProxy
A thread proxy. |
(package private) ThreadEventWaitData |
waitData
Object specifying the event the thread is waiting for. |
| Fields inherited from class org.jikesrvm.scheduler.RVMThread |
|---|
BACKEDGE, beingDispatched, bridgeInstructions, cachedFreeLock, causeOfThreadDeath, contextRegisters, daemon, EPILOGUE, feedlet, fooFPOffset, interrupted, isWaitingForOsr, jniEnv, NATIVE_EPILOGUE, NATIVE_PROLOGUE, onStackReplacementEvent, OSROPT, PROLOGUE, proxyInterruptException, requesting_osr, stackLimit, state, throwInterruptWhenScheduled, trace, tsFPOffset, waitCount, waitObject, wakeupNanoTime |
| Constructor Summary | |
|---|---|
|
GreenThread(byte[] stack,
String name)
Create a thread with the given stack and name. |
protected |
GreenThread(byte[] stack,
Thread thread,
String name,
boolean daemon,
boolean system,
int priority)
Create a thread. |
|
GreenThread(String name)
Create a thread with default stack and with the given name. |
|
GreenThread(Thread thread,
long stacksize,
String name,
boolean daemon,
int priority)
Create a thread with ... called by java.lang.VMThread.create. |
| Method Summary | |
|---|---|
void |
block(ThreadQueue entering,
ProcessorLock mutex)
Thread is blocked on a heavyweight lock |
GreenThread |
getNext()
Get the next element after this thread in a thread queue |
String |
getThreadState()
Give a string of information on how a thread is set to be scheduled |
static void |
ioWaitImpl(ThreadIOWaitData waitData)
Put given thread onto the IO wait queue. |
(package private) boolean |
isQueueable()
Is this thread suitable for putting on a queue? |
protected void |
killInternal()
Thread model dependent part of stopping/interrupting a thread |
(package private) static void |
morph()
|
(package private) static void |
morph(boolean timerTick)
Current thread has been placed onto some queue. |
protected void |
notifyAllInternal(Object o,
Lock lock)
Support for Java Object.notify() synchronization primitive. |
protected void |
notifyInternal(Object o,
Lock lock)
Support for Java Object.notify() synchronization primitive. |
void |
osrPark()
Park the thread for OSR. |
void |
osrUnpark()
Unpark the thread from OSR. |
static void |
processWaitImpl(ThreadProcessWaitData waitData,
VMProcess process)
Put given thread onto the process wait queue. |
protected void |
registerThreadInternal()
Update internal state of Thread and Scheduler to indicate that a thread is about to start |
protected void |
resumeInternal()
Thread model dependent part of thread resumption |
void |
schedule()
Put this thread on ready queue for subsequent execution on a future timeslice. |
void |
setNext(GreenThread next)
Set the next element after this thread in a thread queue |
private boolean |
sleepImpl(ThreadProxy proxy)
Uninterruptible portion of going to sleep |
protected void |
sleepInternal(long millis,
int ns)
Thread model dependant sleep |
void |
start(GreenThreadQueue q)
Start execution of 'this' by putting it on the given queue. |
(package private) boolean |
suspendIfPending()
Suspend thread if a suspend is pending. |
protected void |
suspendInternal()
Thread model dependent part of thread suspension |
static void |
timerTickYield(int whereFrom)
Suspend execution of current thread, in favor of some other thread. |
void |
unblock()
Unblock thread from heavyweight lock blocking |
private Throwable |
waitImpl(Object o,
GreenLock l,
boolean hasTimeout,
long millis,
ThreadProxy proxy)
Unpreemptible portion of waiting |
protected Throwable |
waitInternal(Object o)
Support for Java Object.wait() synchronization primitive. |
protected Throwable |
waitInternal(Object o,
long millis)
Support for Java Object.wait() synchronization primitive. |
private Throwable |
waitInternal2(Object o,
boolean hasTimeout,
long millis)
Combine the two outer waitInternal into one bigger one |
static void |
yield()
Suspend execution of current thread, in favor of some other thread. |
static void |
yield(AbstractThreadQueue q)
Suspend execution of current thread in favor of some other thread. |
void |
yield(AbstractThreadQueue q,
ProcessorLock l)
Suspend execution of current thread in favor of some other thread. |
void |
yield(ProcessorLock l,
RVMThread.State newState)
Suspend execution of current thread, change its state, and release a lock. |
private static void |
yield(ThreadProxyWaitingQueue q1,
ProcessorLock l1,
ThreadProxyWakeupQueue q2,
ProcessorLock l2)
For timed wait, suspend execution of current thread in favor of some other thread. |
static void |
yieldpoint(int whereFrom,
Address yieldpointServiceMethodFP)
Process a taken yieldpoint. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final Offset suspendPendingOffset
private static final ProcessorLock osrParkLock
private boolean osrParkingPermit
private volatile int suspendPending
private GreenThread next
public int chosenProcessorId
public ThreadProxy threadProxy
ThreadEventWaitData waitData
public GreenProcessor processorAffinity
| Constructor Detail |
|---|
public GreenThread(String name)
public GreenThread(byte[] stack,
String name)
CollectorThread and the
boot image writer for the boot thread.
public GreenThread(Thread thread,
long stacksize,
String name,
boolean daemon,
int priority)
protected GreenThread(byte[] stack,
Thread thread,
String name,
boolean daemon,
boolean system,
int priority)
| Method Detail |
|---|
public final GreenThread getNext()
public final void setNext(GreenThread next)
protected final void registerThreadInternal()
registerThreadInternal in class RVMThreadpublic final void start(GreenThreadQueue q)
q - the ThreadQueue on which to enqueue this thread.
public final void block(ThreadQueue entering,
ProcessorLock mutex)
Lock.lockHeavy(Object)public final void unblock()
Lock.unlockHeavy(Object)
public static void yieldpoint(int whereFrom,
Address yieldpointServiceMethodFP)
public static void timerTickYield(int whereFrom)
whereFrom - backedge, prologue, epilogue?public static void yield()
public final void yield(AbstractThreadQueue q,
ProcessorLock l)
q - queue to put thread ontol - lock guarding that queue (currently locked)
public final void yield(ProcessorLock l,
RVMThread.State newState)
l - lock guarding the decision to suspendnewState - state to change to
private static void yield(ThreadProxyWaitingQueue q1,
ProcessorLock l1,
ThreadProxyWakeupQueue q2,
ProcessorLock l2)
q1 - the ThreadProxyWaitingQueue upon which to wait for notificationl1 - the ProcessorLock guarding q1 (currently locked)q2 - the ThreadProxyWakeupQueue upon which to wait for timeoutl2 - the ProcessorLock guarding q2 (currently locked)static void morph()
static void morph(boolean timerTick)
timerTick - timer interrupted if truepublic static void yield(AbstractThreadQueue q)
q - queue to put thread onto (must be processor-local, ie.
not guarded with a lock)
protected final void sleepInternal(long millis,
int ns)
throws InterruptedException
sleepInternal in class RVMThreadmillis - ns -
InterruptedExceptionprivate boolean sleepImpl(ThreadProxy proxy)
protected final Throwable waitInternal(Object o)
Object.wait() synchronization primitive.
waitInternal in class RVMThreado - the object synchronized on
protected final Throwable waitInternal(Object o,
long millis)
Object.wait() synchronization primitive.
waitInternal in class RVMThreado - the object synchronized onmillis - the number of milliseconds to wait for notification
private Throwable waitInternal2(Object o,
boolean hasTimeout,
long millis)
o - the object to wait uponhasTimeout - have a timeout ?millis - timeout value
private Throwable waitImpl(Object o,
GreenLock l,
boolean hasTimeout,
long millis,
ThreadProxy proxy)
protected final void notifyInternal(Object o,
Lock lock)
Object.notify() synchronization primitive.
notifyInternal in class RVMThreado - the object synchronized onlock - the heavy weight lock
protected final void notifyAllInternal(Object o,
Lock lock)
Object.notify() synchronization primitive.
notifyAllInternal in class RVMThreado - the object synchronized onlock - the heavy weight lockpublic static void ioWaitImpl(ThreadIOWaitData waitData)
waitData - the wait data specifying the file descriptor(s)
to wait for.
public static void processWaitImpl(ThreadProcessWaitData waitData,
VMProcess process)
waitData - the wait data specifying which process to wait forprocess - the Process object associated
with the processprotected final void killInternal()
killInternal in class RVMThreadprotected final void suspendInternal()
suspendInternal in class RVMThreadprotected final void resumeInternal()
resumeInternal in class RVMThreadfinal boolean suspendIfPending()
public void osrPark()
osrPark in class RVMThreadpublic void osrUnpark()
osrUnpark in class RVMThreadpublic final void schedule()
schedule in class RVMThreadpublic String getThreadState()
getThreadState in class RVMThreadfinal boolean isQueueable()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||