ExProd


code

pworkers = 10;
count = 10;
res = 0;

SocketChannel chan;

con i = 1 to pworkers do
  Producuer(i);
end

Producer(i) {
  for i = 1 to count do
    put i in chan;
  end
}

java source code