This is an extension of the Parallel class that prioritises the processes given to its control.
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 and description |
---|
PriParallel
() Construct a new PriParallel object initially without any processes. |
PriParallel
(CSProcess[] processes) Construct a new PriParallel object with the processes specified. |
Type | Name and description |
---|---|
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 | Name |
---|---|
class Parallel |
addProcess, addProcess, destroy, finalize, getNumberProcesses, releaseAllThreads, removeAllProcesses, removeProcess, resetDestroy, run, setUncaughtErrorDisplay, setUncaughtExceptionDisplay |
Construct a new PriParallel object initially without any processes. Processes may be added later using the inherited addProcess methods. The order of their adding is significant, with ealier processes having higher priority.
Construct a new PriParallel object with the processes specified. The ordering of the processes in the array is significant, with ealier processes having higher priority. The last process in the array inherits the priority of the constructing process.
processes
- The processes to be executed in parallelThis returns the current priority of this process.
Insert another process to the pri-parallel object at the specifed index. The point of insertion is significant because the ordering of process components determines the priorities. The extended network will be executed the next time run() is invoked.
process
- the process to be insertedindex
- the index at which to insert the processThis changes the priority of this process. Note that JCSP only provides this method for changing the priority of the invoking process. Changing the process of another process is not considered wise.
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.
JCSP for Java 1.8 generated 14-10-2016 by Jon Kerridge, Edinburgh Napier University - j dot kerridge at napier dot ac dot uk