From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,80b3e504140e89fd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-24 11:53:16 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Config_Files proposal Date: 24 Jun 2002 14:53:14 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <3D0FAC67.A4861809@san.rr.com> <3D10B6B1.AFE9D4E8@san.rr.com> <3D10E046.E604231D@san.rr.com> <3D1204B5.4620F160@san.rr.com> <3D1215A8.719D39C5@nbi.dk> <3D123852.1040508@san.rr.com> <3D1289D2.9090107@telepath.com> <3D134669.5070000@san.rr.com> <3D173599.C515EE53@san.rr.com> <3D175DA2.D6F8F41D@san.rr.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1024945232 604 128.183.220.71 (24 Jun 2002 19:00:32 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 24 Jun 2002 19:00:32 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:26665 Date: 2002-06-24T19:00:32+00:00 List-Id: Darren New writes: > Stephen Leake wrote: > > Because you need "real locks", and you need to guard against all the > > possible race conditions. The registry already does that. > > But you can eliminate a large number of race conditions by implementing a > merge. You can change it from "if you start the same program twice, you're > screwed" to "if you click the button on both instances in the length of time > it takes to write the file, you're screwed." I think that's reasonable. I see. > You might not. Right, I don't. I tend to be very picky; a file locking protocol is either "right", or it's "wrong"; no room for "mostly right" :). > > What's wrong with the answers I gave (besides "I don't like them" > > :)? > > Well, it's an opinion. I was hoping for something technical, that would allow judging the benefit against the cost of doing file locking right. > > If we want to support this scenario (multiple processes reading > > and writing to shared config file), we need "real locks". > > Sure, there's a race condition if you write the file between the time you > check if it has changed and the time you write it out. I think that's a much > smaller window than the window between the time you start the program and > the time you exit it. It is smaller, but I'm willing to bet someone will hit it. For example, when you shutdown the computer, all the active editor instances will write to the config file at once. Maybe us "real" programmers don't leave editors active when we shutdown, but a lot of people do! -- -- Stephe