comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@attbi.com>
Subject: Re: Config_Files proposal
Date: Fri, 05 Jul 2002 21:51:02 GMT
Date: 2002-07-05T21:51:02+00:00	[thread overview]
Message-ID: <3D261561.7050500@attbi.com> (raw)
In-Reply-To: ui2btho8gs4b13@corp.supernews.com

Randy Brukardt wrote:


> "Then, if the locking app is aborted or has an unhandled exception, the
> lock will get freed. That prevents program bugs from keeping the file
> locked. (You'll still need some way to deal with OS termination of the
> application's process; probably the lock will have to have a time limit
> on it.)"
> 
> Of course the lock has to be at the OS level. But you don't want to hold
> it any longer than you have to. A controlled object provides protection
> against program bugs holding the lock too long, by automatically
> releasing the OS lock. It doesn't provide the entire solution (OS
> termination - "kill" to Unix-heads - still has to be handled with a time
> limit), but it lets the time limit case be quite rare, so we can leave
> the lock held for quite a while before forcibly releasing it. That makes
> the lock much safer, because if you let the lock be freed too soon (when
> an App really is using it), you have all of the problems again -- only
> worse, because the programmer has an expectation of safety.


Exactly.  The Ada standard has to be easy to use but prevent the 
"stupid" cases.  There will always be a way outside the Ada interface to 
muck things up:  Text editors, registry editors, system crashes, hard 
drive failures, etc.

What we have to worry about is the case of two (often different) Ada 
programs accessing the same configuration file and making a mess of it. 
  In other words, we want to guarantee that as long as all access is 
through the standard Ada package interface, strange things don't happen. 
  If strange things happen in the external environment that foul up the 
configuration file that is not our problem.

As far as I am concerned an interface that provided two types of handles 
should be sufficient.  You either have (shared) read access or unshared 
read-write access to file elements.  Whether the granularity is per 
file, per object, or some definition of group is something worth 
discussing.  But we have to have consistancy.  If one implementation 
locks files (Unix) and another locks objects (Windows Registry) then 
applications are not portable.

Since I feel that simplicity is best, I like the idea of configuration 
file locking.  Normal access is to open the file read it, then close it. 
  If your program wants to update the file it re-opens it read write. 
Yes this will not provide notification if the file changes after a 
program starts, but I think that is reasonable. I just find it hard to 
imagine situations where two programs update different but intersecting 
attributes.  For example let us say that one program changes the font 
size used in an output window, and another sets the size of the window. 
  I certainly want these actions to be done in some consistant order, 
but IMHO it would be bad programming if only one of the programs 
computed the correct line-length information...




  reply	other threads:[~2002-07-05 21:51 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
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 [this message]
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