Answer of exercise 13

Since the child process is an exact copy of the parent, i/o buffers of the standard library are duplicated when fork is executed. If the buffers are not emptied after each write, they must be emptied explicitly just before the call to fork. All is needed is to add flush Pervasives.stdout after the line 14 of the function read_first_prime.

* * *