How to test:
First create two fifos, for example, f1 and f2.
In the first shell, type
$ ./emit 30 f1 f2 < some-test-file
In the second shell, type
$ ./emit 5 < f1
In the third shell, type
$ ./emit 15 < f2
It is important that the rate in 2nd and 3rd emit is slower than the
one for 1st emit so that we can simulate the asynchrous I/O.