The computer should work out the rate and buffer sizes for each task.
Otherwise you need to write complicated error prone threaded code to handle this stuff and shift between buffers.
it could work by automatically doubling all the buffers and flipping between them quickly as they are emptied and
used up, a bit like TCP window sizes.
parallel whilst {
parallel while {
char buf[1024];
os.read("/bigfile", 1024, buf);
}
parallel while {
lines = split(buf, "\n");
}
parallel while {
do_expensive_calculation(lines);
}
}