[Pvfs2-developers] help with kernel dentry revalidate problem
Sam Lang
slang at mcs.anl.gov
Wed Aug 15 22:59:27 EDT 2007
Hi Scott,
You're right, in fact the simul test does do a barrier after the
stat. In the code below, the end() function does an MPI_Barrier.
-sam
void simul_file_stat(int shared) {
char *filename;
struct stat buf;
begin("setup");
filename = create_files("simul_file_stat", 0, shared);
end("setup");
begin("test");
/* All stat the file */
if (stat(filename, &buf) == -1) {
FAIL("stat failed");
}
end("test");
begin("cleanup");
remove_files("simul_file_stat", shared);
end("cleanup");
On Aug 15, 2007, at 7:37 PM, Scott Atchley wrote:
> On Aug 15, 2007, at 6:53 PM, Pete Wyckoff wrote:
>
>> if (task == 0)
>> mkdir("foo");
>>
>> MPI_Barrier();
>> sleep(3);
>>
>> stat("foo");
>>
>> if (task == 0)
>> rmdir("foo");
>>
>
> Hi Pete,
>
> Isn't there a race condition between task 0 and the others after
> the barrier? Can 0 stat the file and rmdir it before another task
> can stat() it? If so, should there be a barrier after the stat()
> and before the rmdir?
>
> Scott
> _______________________________________________
> Pvfs2-developers mailing list
> Pvfs2-developers at beowulf-underground.org
> http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers
>
More information about the Pvfs2-developers
mailing list