HP3000-L Archives

November 2002, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Wirt Atmar <[log in to unmask]>
Reply To:
Date:
Thu, 21 Nov 2002 13:55:28 EST
Content-Type:
text/plain
Parts/Attachments:
text/plain (47 lines)
Ken writes:

> Wirt Atmar writes:
>  >      2. Once done, COPY (filecopy) the source file into the watched
>  > folder/group. This is generally a very high-speed process that will run
at
>  > the speed of the host's backplane.
>
>  Even better is to rename the file, which is an atomic operation.  You have
>  to make sure that the rename will succeed (same volume/file system/etc).

Unfortunately, that's not possible if you don't either know the name of the
file you're looking for or there are likely to be multiple files in the
watched folder.

The "simple" and "hard" cure for the problem is to use the presence of the
file's name in the directory as *the* state variable, where the O/S has
written the name into the directory only *after* the file write has been
completed, not at the outset of the write process. You can't download a file
before you know that it exists.

Unfortunately, I don't know of any operating system that operates in that
manner -- but you could easily simulate the process in MPE if the COPY
operation allowed file copy into a temporary file (which it unfortunately
doesn't). In this scenario, the MPE job would copy the file first into the
watched folder as a ;TEMP file, rendering it invisible to FTP's directory
request. Only after the file transfer had been completed would the file be
SAVEd, moving it from the job's temp domain into the permanent. That too
would be an atomic transaction and would be absolutely, positively 100%
guaranted to be "safe". The presence of the file name in the permanent
directory would then become a completely faithful state variable, indicating
that a full and complete file is available for immediate download.

Nonetheless, as I wrote earlier, the windows of vulnerability under polling
download are very small and can be easily overcome. As Jeff Vance, Craig
Fairchild or James Hoffmeister can tell you, potential race conflicts
permeate the design of all multiuser, multitasking machines, including MPE,
and not all of them can be designed out of the system, even with the use of
semaphores, locks and flags. What you do instead is attempt to make their
possibility of occurrence so improbable that they'll occur only once or twice
during the lifetime of the planet.

Wirt Atmar

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2