public class ProcessWriteInt extends java.lang.Object implements CSProcess
ProcessWriteInt 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.
Output Channels | ||
---|---|---|
out | int | All channels in this package carry integers. |
Parallel
object in which to run them:
ChannelOutputInt out0, out1; . . . ProcessWriteInt write0 = new ProcessWriteInt (out0); ProcessWriteInt write1 = new ProcessWriteInt (out1); CSProcess parWrite01 = new Parallel (new CSProcess[] {out0, out1});The above is best done once, before any looping over the parallel read commences. A parallel write can now be performed at any time (and any number of times) by executing:
write0.value = ...; // whatever we want sent down out0 write1.value = ...; // whatever we want sent down out1 parWrite01.run ();This terminates when, and only when, both writes have completed -- the events may occur in any order.
Parallel
,
ProcessRead
,
ProcessWrite
,
ProcessReadInt
Modifier and Type | Field and Description |
---|---|
int |
value
The int to be written to the channel
|
Constructor and Description |
---|
ProcessWriteInt(ChannelOutputInt out)
Construct a new ProcessWriteInt.
|
Modifier and Type | Method and Description |
---|---|
void |
run()
The main body of this process.
|
public ProcessWriteInt(ChannelOutputInt out)
out
- the channel to which to writeCopyright © 1996–2022. All rights reserved.