Synchronous concurrency: Difference between revisions
m
→{{header|Oforth}}
m (→{{header|TXR}}: Fix lang tag.) |
|||
Line 1,519:
When the file has been read and sent to channel chPrint, this channel is closed. All tasks waiting for an object in this channel are released and receive null. Then printing task returns number of printed lines into chCount channel for the main task.
<lang Oforth>
0 while(chPrint receive dup notNull) [ println 1 + ] drop▼
chCount send drop▼
: printing(chPrint, chCount)
func: concurrentPrint(aFileName)▼
▲ chCount send drop ;
| chPrint chCount line |
Channel new ->chPrint
Line 1,533 ⟶ 1,532:
#[ printing(chPrint, chCount) ] &
chPrint close
chCount receive "Number of lines printed : " print println ;</lang>
=={{header|ooRexx}}==
|