Mailinglist Archive: opensuse-programming (52 mails)

< Previous Next >
Re: [suse-programming-e] The meaning of atomic in write()
  • From: Verdi March <cincaipatron@xxxxxxx>
  • Date: Wed, 5 Apr 2006 22:39:31 +0800
  • Message-id: <200604052239.31421.cincaipatron@xxxxxxx>
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@xxxxxx

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
< Previous Next >
List Navigation
Follow Ups