|
CSP for Java (JCSP) 1.1-rc1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jcsp.lang.Parallel
org.jcsp.lang.PriParallel
public class PriParallel
This is an extension of the Parallel
class that prioritises
the processes given to its control.
Parallel
class that prioritises
the processes given to its control.
The ordering of the processes in
the array passed to the constructor (or added/inserted later) is significant,
with earlier processes having higher priority. The last process in the
array inherits the priority of the constructing process. That priority may
be set explicitly by setPriority
.
Implementation Note: these priorities are currently implemented using the underlying threads priority mechanism. If there are more priorities required than the maximum allowed for the threadgroup of the spawning process, the higher requested priorities will be truncated to that maximum. Also, the semantics of priority will be that implemented by the JVM being used.
Constructor Summary | |
---|---|
PriParallel()
Construct a new PriParallel object initially without any processes. |
|
PriParallel(CSProcess[] processes)
Construct a new PriParallel object with the processes specified. |
Method Summary | |
---|---|
static int |
getPriority()
This returns the current priority of this process. |
void |
insertProcessAt(CSProcess process,
int index)
Insert another process to the pri-parallel object at the specifed index. |
static void |
setPriority(int newPriority)
This changes the priority of this process. |
Methods inherited from class org.jcsp.lang.Parallel |
---|
addProcess, addProcess, destroy, finalize, getNumberProcesses, releaseAllThreads, removeAllProcesses, removeProcess, resetDestroy, run, setUncaughtErrorDisplay, setUncaughtExceptionDisplay |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PriParallel()
public PriParallel(CSProcess[] processes)
processes
- The processes to be executed in parallelMethod Detail |
---|
public void insertProcessAt(CSProcess process, int index)
process
- the process to be insertedindex
- the index at which to insert the processpublic static int getPriority()
public static void setPriority(int newPriority)
Implementation Note: these priorities are currently implemented
using the underlying threads priority mechanism - hence run time
exceptions corresponding to the Thread
.getPriority()
may be thrown.
java.lang.IllegalArgumentException
- if the priority is not
in the range supported by the underlying threads implementation.
java.lang.SecurityException
- if the security manager of
the underlying threads implementation will not allow this modification.
|
CSP for Java (JCSP) 1.1-rc1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |