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:
Stan Sieler <[log in to unmask]>
Reply To:
Stan Sieler <[log in to unmask]>
Date:
Thu, 21 Nov 2002 15:43:18 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (70 lines)
Re:

> It's this small difference of putting the filename into the directory at the
> beginning of the file open process, prior to the actual file copy, and
> putting it there at the close of the process that makes all of the difference
> between a polling process being "virtually impossible" to screw up (if all of
> the necessary precautions are taken) and one that is flat-out impossible to
> screw up.

Yep...that's why I'm surprised that COPY does it the "insert immediately"
way.

There are good reasons for having both methods.  In some cases, one wants
to get the disk file inserted in the directory at the start because:

  - you find out at FOPEN time if the file name is available for use

  - if the application aborts before the final FCLOSE (, 1), you've
    may have some useful data in the file.

OTOH, one wants the original MPE semantics (file name not inserted into
directory) because:

  - if you see it, you can use it

  - no partial file data

> Nonetheless, Ken Hirsch's RENAME is answer -- and the gold standard. By the
> time that the RENAME command would have been issued by a job, the source file
> would have been built, fully populated and completely stable. Moving the

yep.

> state variable indicator of the presence of the file. Using Ken's method,
> there can never be problems associated with polling simply because there is
> no window of vulnerability, no matter how small it might be.

Not true (the "can never be problems" part).

Polling has three intrinsic problems:

  1) knowing if the file is "ready"
     ... however, the insert-into-directory-at-end solves this problem.

     (BTW, DOS and Windows seem to insert the file into the
     directory at file-open time, although the EOF doesn't seem to
     get updated until file close time)

  2) performance: response time

     If the polling is not extremely frequent, there's a time gap
     between the file being ready and the file being noticed.

  3) performance: CPU waste

     If the polling is extremely frequent, a lot of CPU is wasted
     by the polling.

One simply cannot escape the second two problems.  (I.e., one
can minimize one at the cost of the other, but one cannot
eliminate both problems.)  That's why a notification mechanism
is greatly to be desired.  Trust me...that's an OS designer speaking here :)

--
Stan Sieler                                           [log in to unmask]
www.allegro.com/sieler/wanted/index.html                  www.sieler.com

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

ATOM RSS1 RSS2