public abstract class AbstractBusyThread extends AbstractThread implements BusyThread
Modifier and Type | Field and Description |
---|---|
private long |
busyCycles |
private long |
busyPause |
private long |
busySleep |
private long |
highCPUCycles |
private long |
idleCycles |
private long |
idlePause |
private long |
idleSleep |
private long |
idletime |
private long |
intermission |
private boolean |
intermissionObedient |
private double |
loadprereq |
private static ConcurrentLog |
log |
private long |
memprereq |
private long |
outofmemoryCycles |
private long |
startup |
private java.lang.Object |
syncObject |
busytime, memuse, running
Constructor and Description |
---|
AbstractBusyThread(long minidleSleep,
long minbusySleep)
Initializes the AbstractBusyThread with min allowed sleep time (in milliseconds)
and sets the actual sleep time to this values.
|
Modifier and Type | Method and Description |
---|---|
long |
getBusyCycles() |
long |
getBusySleep()
gets the sleep time for pauses between two jobs if the job returns true (busy)
|
long |
getHighCPUCycles() |
long |
getIdleCycles() |
long |
getIdleSleep()
gets the sleep time for pauses between two jobs if the job returns false (idle)
|
long |
getOutOfMemoryCycles() |
long |
getSleepTime() |
void |
intermission(long pause)
the thread is forced to pause for a specific time
if the thread is busy meanwhile, the pause is ommitted
|
private void |
logSystem(java.lang.String text) |
void |
notifyThread() |
private void |
ratz(long millis) |
void |
run() |
long |
setBusySleep(long milliseconds)
Set the delay between busy cycles to the larger of the input argument
and the min allowed delay defined on init
|
long |
setIdleSleep(long milliseconds)
Set the delay between idle cycles to the larger of the input argument
and the min allowed delay defined on init
|
double |
setLoadPreReqisite(double load)
sets maximimum load for the job execution
|
void |
setMemPreReqisite(long freeBytes)
sets minimum required amount of memory for the job execution
|
void |
setObeyIntermission(boolean obey)
defines if the thread should obey the intermission command
|
void |
setStartupSleep(long milliseconds)
sets a sleep time before execution of the job-loop
|
announceThreadBlockApply, announceThreadBlockRelease, close, getBlockTime, getExecTime, getLongDescription, getMemoryUse, getMonitorURL, getShortDescription, jobExceptionHandler, open, setDescription, shutdownInProgress, terminate
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
freemem, job
close, getBlockTime, getExecTime, getJobCount, getLongDescription, getMemoryUse, getMonitorURL, getShortDescription, isAlive, jobExceptionHandler, open, setDescription, shutdownInProgress, start, terminate
private static final ConcurrentLog log
private long startup
private long intermission
private long idlePause
private long busyPause
private long idletime
private long memprereq
private long idleCycles
private long busyCycles
private long outofmemoryCycles
private long highCPUCycles
private double loadprereq
private boolean intermissionObedient
private final java.lang.Object syncObject
private final long idleSleep
private final long busySleep
public AbstractBusyThread(long minidleSleep, long minbusySleep)
minidleSleep
- defines min idle sleep time that can be set via setIdleSleep()minbusySleep
- defines min busy sleep time that can be set via setBusySleep()public final void setStartupSleep(long milliseconds)
BusyThread
setStartupSleep
in interface BusyThread
public final long setIdleSleep(long milliseconds)
setIdleSleep
in interface BusyThread
milliseconds
- public final long getIdleSleep()
BusyThread
getIdleSleep
in interface BusyThread
public final long setBusySleep(long milliseconds)
setBusySleep
in interface BusyThread
milliseconds
- public final long getBusySleep()
BusyThread
getBusySleep
in interface BusyThread
public void setMemPreReqisite(long freeBytes)
BusyThread
setMemPreReqisite
in interface BusyThread
public double setLoadPreReqisite(double load)
BusyThread
setLoadPreReqisite
in interface BusyThread
public void setObeyIntermission(boolean obey)
BusyThread
setObeyIntermission
in interface BusyThread
public final long getIdleCycles()
getIdleCycles
in interface BusyThread
public final long getBusyCycles()
getBusyCycles
in interface BusyThread
public long getOutOfMemoryCycles()
getOutOfMemoryCycles
in interface BusyThread
public long getHighCPUCycles()
getHighCPUCycles
in interface BusyThread
public final long getSleepTime()
getSleepTime
in interface BusyThread
public void intermission(long pause)
BusyThread
intermission
in interface BusyThread
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
private void ratz(long millis)
public void notifyThread()
private void logSystem(java.lang.String text)