[racket-dev] atomic file update by write & rename... not!

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Fri Jan 14 14:11:15 EST 2011

So just use all of the wonderful syncronization stuff we have in
Racket for that! The file system as syncronization operation is sooo
low level (ahm, "inconvenient" ;)

Robby

On Fri, Jan 14, 2011 at 12:50 PM, Eli Barzilay <eli at barzilay.org> wrote:
> Yesterday, Matthew Flatt wrote:
>> At Thu, 13 Jan 2011 16:30:08 -0500, Eli Barzilay wrote:
>> > 15 minutes ago, Matthew Flatt wrote:
>> > > Is there anything else in the main distribution that is uses
>> > > `rename-file-or-directory' for atomic update?
>> >
>> > Is the handin-server's use kosher?  There are three uses of it,
>> > and the only one that looks suspicious is the last one, where
>> > "ATTEMPT" is renamed to "SUCCESS-0".
>>
>> Those are directories, and you can't move to an existing directory
>> name on any platform, right?
>>
>> I think the handin server probably depends on non-concurrent handins
>> for a given account, though, since it shuffles many files and
>> directories around. Probably it should use some sort of lock to
>> enforce non-concurrency.
>
> I think that it does, but I don't remember...  In any case, it sounds
> like if some locking is necessary it will be made obvious by an
> exception.
>
>
> Yesterday, Robby Findler wrote:
>>
>> In general, it seems like the handin server can safely make the
>> assumption that there is only one sever running for a given
>> directory and thus can do all of the syncronization at the Racket
>> level (unlike the preferences file).
>
> Yeah, the issue is not multiple servers, but the single server trying
> to run two concurrent submissions.
>
> --
>          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                    http://barzilay.org/                   Maze is Life!
>


Posted on the dev mailing list.