public class ProcessRead
Reads one Object from its input channel.
ProcessRead declaration, construction and use should normally be localised within a single method -- so we feel no embarassment about its public field. Its only (envisaged) purpose is as described in the example below.
Input Channels | ||
---|---|---|
in | java.lang.Object | The in Channel can accept data of any Class. |
ChannelInput in0, in1; . . . ProcessRead read0 = new ProcessRead (in0); ProcessRead read1 = new ProcessRead (in1); CSProcess parRead01 = new Parallel (new CSProcess[] {in0, in1});The above is best done once, before any looping over the parallel read commences. A parallel read can now be performed at any time (and any number of times) by executing:
parRead01.run ();This terminates when, and only when, both reads have completed -- the events may occur in any order. The values read may then be found in read0.value and read1.value, where they may be safely accessed up until the time that parRead01 is run again.
Constructor and description |
---|
ProcessRead
(ChannelInput in) Construct a new ProcessRead. |
The Object read from the channel
Construct a new ProcessRead.
in
- the channel from which to readJCSP for Java 1.8 generated 14-10-2016 by Jon Kerridge, Edinburgh Napier University - j dot kerridge at napier dot ac dot uk