From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Config_Files proposal
Date: 20 Jun 2002 10:03:11 -0400
Date: 2002-06-20T14:10:51+00:00 [thread overview]
Message-ID: <uadpqujxc.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 3D10E046.E604231D@san.rr.com
Darren New <dnew@san.rr.com> writes:
> Stephen Leake wrote:
> > Ok. Do you think that prevents us from agreeing on which file format
> > to go forward with?
>
> I'm not sure why you're implementing two bodies while the spec is still in
> flux. :-) Either file format you want to support is OK by me.
Fair enough.
> > > What about values you don't change?
> >
> > As I said below, only values changed since being read from the config
> > file will be written; unchanged values are not written.
>
> Then you're screwed. If I load 20 values out of a config file, change one,
> and save it, then I'll lose 19 config values?
Yes, this is bad.
> > > What about values that you change back to match what's in
> > > /usr/local/app/config?
> >
> > Well, I guess we could provide an "undo" command. I guess "undo" can
> > simply delete the value from the writeable tree, which will expose the
> > value in the read-only tree (assuming there is one).
>
> I don't think that's quite what I meant. I meant that default values
> probably shouldn't be stored, even if you got them by assigning the default
> to the key.
Yes. The default is provided again with every call to "read", so it
does not need to be stored.
> I think until you (we) work out the semantics of what's going on,
> implementing multiple bodies is relatively unhelpful to progressing
> the spec.
Well, I usually find problems with a spec when I get around to
implementing the body. I did these two implementations to see if there
were any problems with the spec that were related to the file format.
I don't think there are.
> Of course, if you're enjoying it and all, that's something else. :-)
I was trying to eliminate one of the variables in the problem. If we
agree on what the file format is, that's one less thing to think about.
I think we are ready to do that, and it will allow people to focus
solely on the spec, rather than on the XML vs ini etc.
> > Seriously, you've set up a race condition, which is an indication
> > of bad design. If you want multiple instances of your app running,
> > each with its own persistent window positions, you need multiple
> > config files. That is precisely one of my use cases, and why I
> > argued for specifying the config file on the app command line.
>
> That's not what I'm saying.
>
> I'm saying I open my text editor for file XYZ.ads, and another for XYZ.adb,
> and then I move XYZ.adb off to the side. Then, in XYZ.ads, I configure all
> kinds of things to do the proper indenting for Ada, and then I close
> XYZ.ads. Since I want XYZ.adb to see these changes, I close that, and reopen
> it. Unfortunately, XYZ.adb didn't reload any changes I made in the indenting
> configuration section, so all that work's gone.
Let's see. You have two instances of "text_edit", sharing one config
file. That is explicitly forbidden by requirement 1.
So if you want this behavior, you have to use the registry or gconf,
not Config_Files.
> Bad news.
>
> Relatively easy to fix - when a config file is saved, it is first read off
> the disk, then any values in the in-memory configuration that differ from
> the just-loaded configuration and which have been changed since they were
> loaded (or since the last save?) are copied to the just-loaded
> configuration, then the just-loaded configuration is written back out.
This is a race condition. Suppose two processes happen to start a
"flush" operation "at the same time"? Whichever goes last wins.
That's why we have requirement 1. Config_Files don't do this.
If you feel that makes Config_Files totally useless, I guess we can
talk about removing requirement 1 and see if we can come up with
locking semantics to fix it. But I'd rather not, especially since the
registry and gconf have already done that.
In general, I suggest that there are other ways to fix an apparent
need for concurrent access to config files.
For the specific case of a text editor, you can use a text editor that
supports multiple documents; that provides automatic sharing of config
file settings between XYZ.adb and XYZ.ads.
> > > I think if you're not careful, there's going to be very
> > > unintuitive behavior.
> >
> > Which is why we ruled out multiple processes from the beginning.
>
> OK. I'd misinterpreted, thinking you meant only one process could read or
> write at a time, rather than only one process could be using a configuration
> at a time.
Ok, I guess I need to make that clearer. I thought one implied the
other :). Your example is more complex than I had in mind; I'll try to
include something like it in the final rationale document.
> > Let me ask again; can we choose the general file format now, or do
> > you think we need to work on the API more first?
>
> I think you can pick the file format, sure. If you have "heirarchy of keys
> mapped to string values", I don't see much more you need to know for that.
But I want _you_ to pick a format, so we can get consensus. Hmm. You said
above either is ok; I guess that counts as consensus for the Java
property format.
--
-- Stephe
next prev parent reply other threads:[~2002-06-20 14:03 UTC|newest]
Thread overview: 132+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-18 17:07 Config_Files proposal Stephen Leake
2002-06-18 21:55 ` Darren New
2002-06-19 16:11 ` Stephen Leake
2002-06-19 16:51 ` Darren New
2002-06-19 18:39 ` Stephen Leake
2002-06-19 19:48 ` Darren New
2002-06-20 14:03 ` Stephen Leake [this message]
2002-06-20 16:36 ` Darren New
2002-06-20 17:49 ` Jacob Sparre Andersen
2002-06-20 20:00 ` Stephen Leake
2002-06-20 20:16 ` Darren New
2002-06-20 20:45 ` Stephen Leake
2002-06-21 2:06 ` Ted Dennison
2002-06-21 12:55 ` Marin David Condic
2002-06-24 13:20 ` Stephen Leake
2002-06-21 15:29 ` Darren New
2002-06-24 13:16 ` Stephen Leake
2002-06-24 15:06 ` Darren New
2002-06-24 17:09 ` Stephen Leake
2002-06-24 17:57 ` Darren New
2002-06-24 18:53 ` Stephen Leake
2002-06-24 21:24 ` Darren New
2002-06-29 3:15 ` Ted Dennison
2002-06-28 23:21 ` Randy Brukardt
2002-06-29 3:01 ` Ted Dennison
2002-07-01 20:58 ` Randy Brukardt
2002-07-02 0:31 ` Ted Dennison
2002-07-02 4:43 ` Randy Brukardt
2002-07-05 21:51 ` Robert I. Eachus
2002-06-20 19:54 ` Stephen Leake
2002-06-19 6:53 ` Dr. Michael Paus
2002-06-19 15:18 ` Ted Dennison
2002-06-19 15:08 ` Ted Dennison
2002-06-19 16:18 ` Robert I. Eachus
2002-06-19 16:53 ` Darren New
2002-06-19 18:22 ` Stephen Leake
2002-06-20 13:12 ` Marin David Condic
2002-06-24 13:09 ` Stephen Leake
2002-06-24 15:08 ` Darren New
2002-06-24 17:13 ` Stephen Leake
2002-06-24 17:59 ` Darren New
2002-06-24 19:04 ` Stephen Leake
2002-06-24 21:29 ` Darren New
2002-06-25 12:52 ` Georg Bauhaus
2002-06-25 12:45 ` Georg Bauhaus
2002-06-19 21:32 ` Georg Bauhaus
2002-06-19 18:20 ` Stephen Leake
2002-06-21 20:04 ` Robert I. Eachus
2002-06-24 13:39 ` Stephen Leake
2002-06-19 16:48 ` Marin David Condic
2002-06-20 13:04 ` Georg Bauhaus
2002-06-20 13:53 ` Marin David Condic
2002-06-20 14:19 ` Stephen Leake
2002-06-20 15:37 ` Ted Dennison
2002-06-19 18:15 ` Stephen Leake
2002-06-20 1:35 ` Ted Dennison
2002-06-20 14:10 ` Stephen Leake
2002-06-20 20:50 ` Jacob Sparre Andersen
2002-06-20 20:58 ` Stephen Leake
2002-06-21 2:21 ` Ted Dennison
2002-06-24 13:22 ` Stephen Leake
2002-06-20 1:37 ` Ted Dennison
2002-06-29 11:03 ` Config_Files proposal {long} Bobby D. Bryant
2002-06-29 12:17 ` Bobby D. Bryant
2002-06-29 13:07 ` Mark Biggar
2002-07-03 14:10 ` Georg Bauhaus
-- strict thread matches above, loose matches on Subject: below --
2002-06-14 0:19 Config_Files proposal Stephen Leake
2002-06-02 16:07 config files proposal Stephen Leake
2002-06-02 21:29 ` Darren New
2002-06-02 22:00 ` Darren New
2002-06-02 22:16 ` Stephen Leake
2002-06-03 4:20 ` Darren New
2002-06-09 20:16 ` Stephen Leake
2002-06-10 1:33 ` Darren New
2002-06-10 12:35 ` Stephen Leake
2002-06-10 15:42 ` Darren New
2002-06-10 14:23 ` Georg Bauhaus
2002-06-03 14:56 ` Ted Dennison
2002-06-03 16:08 ` Darren New
2002-06-03 16:24 ` Jean-Marc Bourguet
2002-06-03 16:50 ` Darren New
2002-06-04 11:07 ` Preben Randhol
2002-06-04 19:55 ` Ted Dennison
2002-06-09 20:43 ` Stephen Leake
2002-06-09 20:39 ` Stephen Leake
2002-06-10 1:33 ` Darren New
2002-06-10 10:17 ` Preben Randhol
2002-06-09 20:29 ` Stephen Leake
2002-06-10 1:33 ` Darren New
2002-06-10 18:58 ` Ted Dennison
2002-06-11 18:11 ` Stephen Leake
2002-06-03 15:13 ` Preben Randhol
2002-06-04 15:41 ` Antonio Duran
2002-06-04 15:51 ` Darren New
2002-06-05 10:17 ` Antonio Duran
2002-06-05 14:31 ` Ted Dennison
2002-06-09 20:54 ` Stephen Leake
2002-06-10 1:33 ` Darren New
2002-06-10 12:40 ` Stephen Leake
2002-06-10 15:45 ` Darren New
2002-06-11 13:15 ` Ted Dennison
2002-06-11 16:36 ` Darren New
2002-06-12 7:40 ` Volkert Barr
2002-06-12 15:45 ` Darren New
2002-06-13 8:17 ` Volkert Barr
2002-06-13 13:20 ` Ted Dennison
2002-06-13 13:38 ` Georg Bauhaus
2002-06-11 13:09 ` Ted Dennison
2002-06-13 15:52 ` Georg Bauhaus
2002-06-04 17:06 ` Darren New
2002-06-09 21:01 ` Stephen Leake
2002-06-06 7:57 ` Volkert Barr
2002-06-06 10:04 ` sk
2002-06-06 11:33 ` Volkert Barr
2002-06-06 13:56 ` sk
2002-06-07 8:24 ` Volkert
2002-06-07 9:01 ` Jason King
2002-06-07 11:01 ` Preben Randhol
2002-06-07 17:06 ` Darren New
2002-06-07 17:13 ` Preben Randhol
2002-06-07 17:33 ` Darren New
2002-06-07 18:26 ` Preben Randhol
2002-06-09 21:08 ` Stephen Leake
2002-06-07 15:07 ` Volkert
2002-06-07 15:12 ` Ted Dennison
2002-06-09 21:16 ` Stephen Leake
2002-06-09 21:05 ` Stephen Leake
2002-06-13 9:08 ` Antonio Duran
2002-06-13 14:15 ` Stephen Leake
2002-06-13 21:04 ` Antonio Duran
2002-06-14 16:15 ` Stephen Leake
2002-06-13 18:38 ` Ted Dennison
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox