|
CSP for Java (JCSP) 1.1-rc4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jcsp.plugNplay.ints.ProcessWriteInt
public class ProcessWriteInt
Writes one int to its output channel.
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
Field Summary | |
---|---|
int |
value
The int to be written to the channel |
Constructor Summary | |
---|---|
ProcessWriteInt(ChannelOutputInt out)
Construct a new ProcessWriteInt. |
Method Summary | |
---|---|
void |
run()
The main body of this process. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int value
Constructor Detail |
---|
public ProcessWriteInt(ChannelOutputInt out)
out
- the channel to which to writeMethod Detail |
---|
public void run()
run
in interface CSProcess
|
CSP for Java (JCSP) 1.1-rc4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |