critical sections protecting multiple processes (not threads)

David Carson davidccarson at hotmail.com
Wed Mar 26 10:37:11 EST 2003


All the discussion I've seen regarding critical sections has revolved
around multithreaded applications.  I have the need to protect a
resource that is shared between different Python PROCESSES.  I don't
think the threading discussion applies, right?

Specifically, I want to test for the existence of a file and open if
non-existent in an atomic fashion.  Obviously, if I cannot do this
atomically, it is possible for the file to not exist when the test is
done but to exist before the creation is done.

I don't really know where to look in the documentation for this.  Any
help would be appreciated, as always.

Cheers,
David

P.S. I do NOT generally read the e-mail address associated with this
posting.  For answers sent directly to me, please use dccarson AT
yahooooooooo DOT com (with a little less enthusiasm).




More information about the Python-list mailing list