9.12.

. , :

loop   -—    CHAR   BUFFER.WRITE(CHAR);   exit when CHAR = ASCII.EOT;end loop;

— :

loop   BUFFER.READ(CHAR);   -—      exit when CHAR = ASCII.EOT;end loop;

, -. : IN-INDEX, , OUT_INDEX, .

task BUFFER is   entry READ ( : out CHARACTER);   entry WRITE (C : in   CHARACTER);end:task body BUFFER is   POOL_SIZE : constant INTEGER := 100:   POOL      : array(1 .. POOL_SIZE) of CHARACTER;   COUNT     : INTEGER range 0 .. POOL_SIZE := 0;   IN_INDEX, OUT_INDEX : INTEGER range 1 .. POOL_SIZE := 1;begin    loop       select         when COUNT < POOL_SIZE =>            accept WRITE(C : in CHARACTER) do                POOL(IN_INDEX) := C;            end;            IN_INDEX := IN_INDEX mod POOL_SIZE + 1;            COUNT    := COUNT + 1;      or when COUNT > 0 =>            accept READ(C ; out CHARACTER) do                C := POOL(OUT_INDEX);            end;            OUT_INDEX := OUT_INDEX mod POOL_SIZE + 1;            COUNT     := COUNT - 1;      or         terminate;      end select:   end loop:end BUFFER;