HP3000-L Archives

May 2001, Week 4

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, 24 May 2001 16:48:08 EDT
Content-Type:
text/plain
Parts/Attachments:
text/plain (54 lines)
Ray writes:

> Mary streams the job MYREPORT  which is job 111.  MYREPORT then creates a
>  file FILE111 (file name + jobnum).
>
>  MYREPORT streams NXTREPORT, but how would NXTREPORT know to read the file
>  FILE111?  Even if NXTREPORT tried to read the job queue (to see MYREPORT's
>  job number), MYREPORT may have already finished.
>
>  So, in order for NXTREPORT to read a file known to be created by MYREPORT,
>  MYREPORT would have to create the same file name for NXTREPORT to read
every
>  time (hence, a job pair).  The file name that MYREPORT creates is MYFILE,
>  and NXTREPORT always reads MYFILE.
>
>  The problem with the job pair is that Sue may stream MYREPORT right after
>  MARY, and then MYREPORT.SUE may overwrite the data in the  file MYFILE for
>  NXTREPORT prior to NXTREPORT reading that file to process data from
>  MYREPORT.MARY.
>
>  A work around is to have to the MYREPORT job always insure that no
>  downstream job in the series of jobs is running or queued to run before it
>  begins its actual process (just pause and wait).

Another workaround is to do what many programs, such as Adobe Acrobat
Distiller, etc., on PC's do: enact a "watch folder", and which are often
named something as elaborate as "in" and "out".

In this case, your jobs named MYREPORT would create uniquely named files in
an MPE group that is totally devoted to nothing else other than holding your
created files: FILE111, FILE112, FILE113, etc. You might call this group,
"IN".

At the same time, you have another background job that wakes up every minute
or so and checks to see if there are any files in the "IN" group. If there
are, your job picks up the first file it encounters, processes the data,
creates some sort of output (but does not write it back into the "watch"
group, and then purges the input file it found in the "IN" group. It
continues with this process until there are no more files left in the watch
group, at which time it goes back to sleep for whatever time you've
programmed it to sleep.

When that time is up, it wakes up, checks the watch group again, processes
any files it might find there, and then goes back to sleep again. It's a very
simple process to program up and is only dependent on your capacity to
produce unique file names -- or writing your file-creating jobs to hold off
writing a new file into the watch group until the file with the same current
name is processed and disappears.

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