Anonymous user
Synchronous concurrency: Difference between revisions
no edit summary
No edit summary |
No edit summary |
||
Line 1,139:
{{out}}
<pre>
\ synco.fs Synchronous concurrency for RosettaCode
include co.fs
Line 1,162 ⟶ 1,161:
REPEAT DROP
Line DUP CHAN 2!
CO▼
\ -- Wait for report back
BEGIN CO CHAN CHAN? UNTIL
\ -- Have it, show and go
CR S" -------" TYPE
CR S" LINES: " TYPE CHAN @ ?
Line 1,179 ⟶ 1,182:
CO
REPEAT
0 X CHAN 2!▼
\ -- Chance to stop other writers
CO
\ -- First of writers reports back
\ -- the shared global counter
CHAN CHAN? 0=
IF
THEN
;
\
\ * RUNNER
\
READER WRITER ( WRITER WRITER :-) GO CR BYE
-------
LINES:
</pre>
|