Synchronous concurrency: Difference between revisions

m
Line 79:
STRING line;
INT count := 0, errno;
BOOL jobinput compete := FALSE;
SEMA output throttle = LEVEL 0, input throttle = LEVEL 1;
 
 
FILE input txt;
errno := open(input txt, "input.txt", stand in channel);
 
 
PROC call back done = (REF FILE f) BOOL: ( jobinput compete := TRUE );
on logical file end(input txt, call back done);
 
 
PAR (
WHILE
Line 93:
get(input txt,(line, new line));
UP output throttle;
NOT jobinput compete
DO
count+:=1
Line 100:
WHILE
DOWN output throttle;
NOT jobinput compete
DO
print((line, new line));