[comp.sys.amiga.tech] Async AmigaDOS I/O using locks and packets?

deven@rpi.edu (Deven T. Corzine) (04/13/90)

In reading through the AmigaDOS Manual, (V1.1, Bantam) in the section
on Lock in the AmigaDOS Technical Manual section, it describes
usefulness of locks for checking if a file exists, Lock() having lower
overhead than Open(), and says that locks are used extensively by
AmigaDOS.  Fine.

It also says that locks can also be used for asynchronous I/O, but
does not describe HOW.  Can you Lock() a file and use packets to the
filesystem handler to do asynchronous I/O to AmigaDOS files without
even having to call Open()?  If so, how do you do this?

Deven
-- 
Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
Snail:  2151 12th St. Apt. 4, Troy, NY 12180   Phone:  (518) 274-0327
Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
Simple things should be simple and complex things should be possible.

martint@altitude.CAM.ORG (Martin Taillefer) (04/14/90)

In article <DEVEN.90Apr13060332@netserv2.rpi.edu> deven@rpi.edu (Deven T. Corzine) writes:
>It also says that locks can also be used for asynchronous I/O, but
>does not describe HOW.  Can you Lock() a file and use packets to the
>filesystem handler to do asynchronous I/O to AmigaDOS files without
>even having to call Open()?  If so, how do you do this?

There's no way as of 1.3 to flip flop from a file handle to a file lock and
back from the perspective of the user of a handler.

The best way to do async file system IO is to first open the file using the
normal Open() call, then use the data contained in the FileHandle to
communicate with the file system directly. When you're done, you can then
use the normal Close() to terminate access to the file. I do this all
the time and it works great.

I first implemented this scheme in the M2Sprint compiler. While the compiler
is busy compiling a section of code, an asynchronous file system request
is busy loading the next section of code in memory. This really increases
performance quite a bit with DMA devices.


-- 
----------------------------------------
Martin Taillefer   INTERNET: martin@pnt.CAM.ORG
UUCP: uunet!philmtl!altitude!martint   TEL: 514/640-5734   BIX: vertex

deven@rpi.edu (Deven T. Corzine) (04/14/90)

In article <DEVEN.90Apr13060332@netserv2.rpi.edu> I write:

Deven> It also says that locks can also be used for asynchronous I/O,
Deven> but does not describe HOW.  Can you Lock() a file and use
Deven> packets to the filesystem handler to do asynchronous I/O to
Deven> AmigaDOS files without even having to call Open()?  If so, how
Deven> do you do this?

On 13 Apr 90 22:49:13 GMT, martint@altitude.CAM.ORG (Martin Taillefer) said:

Martin> There's no way as of 1.3 to flip flop from a file handle to a
Martin> file lock and back from the perspective of the user of a
Martin> handler.

Why, then, the cryptic comment in the AmigaDOS manual?

Martin> The best way to do async file system IO is to first open the
Martin> file using the normal Open() call, then use the data contained
Martin> in the FileHandle to communicate with the file system
Martin> directly. When you're done, you can then use the normal
Martin> Close() to terminate access to the file. I do this all the
Martin> time and it works great.

I understand this approach okay.  It doesn't merge real cleanly with
Exec I/O, but c'est la vie.

Deven
-- 
Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
Snail:  2151 12th St. Apt. 4, Troy, NY 12180   Phone:  (518) 274-0327
Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
Simple things should be simple and complex things should be possible.