[racket-dev] the preferences file under Windows

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Thu Jan 13 17:44:33 EST 2011

On Thu, Jan 13, 2011 at 4:36 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> At Thu, 13 Jan 2011 17:29:15 -0500, Eli Barzilay wrote:
>> 30 minutes ago, Matthew Flatt wrote:
>> >
>> > Unfortunately (again), the lock file has to exist alongside the data
>> > file, and our existing preferences files are not accompanied by lock
>> > files. It's no good assuming that you don't need the lock if there's
>> > no lock file present, because the lock file might get created in
>> > between the time that you try to use the lock file and the time that
>> > you try to open the preferences file.
>>
>> Why not always use such a lock file, creating it if it's not there --
>> and then you can open it once per process, and lock/unlock it for each
>> read/write of the actual file.  Does this fail somehow?
>
> That's a good idea. It's a little bit of option 1, in that a reader
> will sometimes need to write a file --- but only in the transitional
> case of dealing with an existing preference file without a lock file.

Also, I think we would have had to do that regardless, unless we
wanted the installation process to create the lockfile or something.

Robby


Posted on the dev mailing list.