Hi Jerry, On Wednesday 05 April 2006 01:01, Jerry Feldman wrote:
You should not get that under any case.
[deleted]
The file descriptor points to the same file structure, so that the location pointers should be correct. The race condition is simply who writes first, If you want you can either post your code or send me the code at gaf@hp.com
I attach the C program, some sample outputs I've collected, and two shell scripts for stress-testing (one for detecting child-overwrites-parent, the other for parent-overwrites-child). Both shell scripts expect a.out in the current directory. The parent-overwrites-child happens more frequently than child-overwrites-parent. In fact, on an Opteron machine (Fedora), only parent-overwrites-child occurs, but not child-overwrites-parent (though I've waited long enough). -- Regards, Verdi