comp.lang.ada
 help / color / mirror / Atom feed
From: mfb@mbunix.mitre.org (Michael F Brenner)
Subject: Re: file locking in Ada
Date: 1997/03/28
Date: 1997-03-28T00:00:00+00:00	[thread overview]
Message-ID: <5hglog$lf8@top.mitre.org> (raw)
In-Reply-To: 333BB430.BF8@aston.ac.uk


In any language, such as Ada or C, you can call an underlying operating
system or file management system, such as Mips OS, VxWorks, Desqview,
Apple OS, CP/M, Starlet, Linus, DOS, etc. 

Ada is a lanaguage which lets you implement file locking within the
language itself. Set up a task which processes all requests for files.
Lets say you are using this for a database management system with
file-at-a-time access, since you wish to have file locking instead of
record locking. Therefore your operations will be a subset of relational
algebra, such as the following: select, merge (or join), import, delete,
and update. Each of these operations would be an entry in the file
request task. No other software talks to the files except through
that file request task. The task processes the requests one at a time,
and that implements TOTAL file locking. 

Now, if you wish to have some operations in parallel and some locked, with
the ability to turn locking on and off, you will need to store the locking
state of each file in a data structure accessible to the file request task.
That data structure will be accessed at each file operation request. Based
on its value, either a parallel task will be issued, or the command will
be queued. 

Record locking is the same logical concept, but implementing it efficiently
is difficult because of the size of the problems where record locking is
useful, and because of the distributed nature of those problems. Therefore,
if you intended to ask about record locking, always use commercial software
to record lock the net.





  reply	other threads:[~1997-03-28  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-28  0:00 file locking in Ada Neil Goodgame
1997-03-28  0:00 ` Michael F Brenner [this message]
1997-03-28  0:00   ` Larry Kilgallen
1997-03-28  0:00   ` Robert Dewar
1997-03-29  0:00     ` Robert A Duff
1997-03-29  0:00       ` Robert Dewar
1997-04-01  0:00         ` Robert A Duff
1997-03-29  0:00       ` Robert Dewar
1997-04-01  0:00         ` Robert A Duff
1997-03-30  0:00 ` Nick Roberts
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox