[m-rev.] io.m latest full diff

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Jan 23 08:00:26 AEDT 2004


Ralph wrote:
> Another issue is whether it should actually open the file for us.  Is it
> guaranteed that you can open a file immediately after creating it or is
> there a race condition on some OSs?

On 22-Jan-2004, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> To the best of my knowledge, it should be possible to open a file
> immediately after creating it on any OS.  I don't see why any OS
> would have a problem with that.

The questions wasn't whether you could, it was whether you are *guaranteed*
to be able to. And the answer is no. Consider this scenario:

process 1 creates file A
process 2 deletes file A
process 1 attempts to open file A

This is a race condition between the two processes.

Fortunately, handling *this* race condition is simple: if the open fails,
nonone will blame process 1 it aborts.

Zoltan.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list