comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: file locking in Ada
Date: 1997/03/28
Date: 1997-03-28T00:00:00+00:00	[thread overview]
Message-ID: <dewar.859565840@merv> (raw)
In-Reply-To: 5hglog$lf8@top.mitre.org


Michael Brenner said (answering a query about 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.>.

If you want simulatneous reads and locked writes, an interesting possibility
is to use a protected type, and use functions for the reads and procedures
for the writes. Of course your implementation has to allow parallel function
calls, which many implementations will not bother with.

Also, in some implementations, a file read/write might be declared a
potentially blocking operation and not be permitted.

It is a pity that protected records have these abstraction glitches :-)





  parent 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
1997-03-28  0:00   ` Larry Kilgallen
1997-03-28  0:00   ` Robert Dewar [this message]
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