HP3000-L Archives

March 2004, 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:
Ken Hirsch <[log in to unmask]>
Reply To:
Ken Hirsch <[log in to unmask]>
Date:
Fri, 26 Mar 2004 14:12:08 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (76 lines)
From: "Tracy Pierce" <[log in to unmask]>
> The question's still open, and seems to revolve around the actual function
> of CLEANXL - is there a temp file involved and a moment of no XL file?
> Duane suggests that I adjust my BUILDXL; while I'm sure it's my code that's
> clobbering the XL, it should never get the opportunity - that buildxl is in
> there for those times when I want a REALLY clean system and simply purge the
> XL before starting.

I suggest you serialize access to the XL using some other mechanism.  You can
use job queues as Paul Christidis suggests.  Or, since you're using MPEX, it's
also fairly simple to lock a file as a proxy for the access to the XL file
(which you can't lock).

I use two brief MPEX command files, LOCKFILE and UNLOCKFL for similar
purposes.  It would work like this:

LOCKFILE XLLOCK.!EXE
   do all your XL stuff here
UNLOCKFL

Where LOCKFILE is this:
PARM LOCKNAME

setjcw INSIDEMPEX 0
IF INSIDEMPEX <> 1
  ECHO ERROR: This program (!HPFILE) must be run from MPEX
  SETJCW JCW -1
  ESCAPE
ENDIF

SETVAR LOCKFNUM VEFOPEN("!LOCKNAME,OLD;MAYBUILD;ACC=IN;SHR;LOCK")
SETLVAR FLOCK VEFLOCK(lockfnum, TRUE)
#***********************************************

and UNLOCKFL is this:
# Unlocks the file that was locked in LOCKFILE.SCRIPTS, q. v.
# Note that the file descriptor is stored in global CI variable LOCKFNUM

SETLVAR FLOCK VEFUNLOCK(LOCKFNUM)
SETLVAR FLOCK VEFCLOSE(LOCKFNUM)
#***********************************************

Your job stream might look like this (untested)
 LOCKFILE XLLOCK.!EXE
   IF NOT FINFO ("XL.!'EXE'","EXISTS")
     warnf !WHO2TELL !hpjobnum !hpjobname @No XL.!"EXE" found!!!, building i
     CONTINUE
     LINKEDIT "BUILD XL.!EXE"
   ENDIF
   SETJCW CIERROR 0
   ECHO XL XL.!"EXE"                   > LINKCMDS
   ECHO ADDXL O!"PGM".!"OBJ";REPLACE;SHARE >> LINKCMDS
   ECHO CLEANXL;COMPACT                >> LINKCMDS
   ECHO EXIT                           >> LINKCMDS
   CONTINUE
     RUN LINKEDIT.PUB.SYS;STDIN=LINKCMDS
     IF  LKEDSTAT = 0
         TELL !WHO2TELL ADDXL O!"PGM".!"OBJ" to XL.!"OBJ" looks ok
         SETVAR ADDXL_OK 1
     ELSE
         SHOWJCW CIERROR
         SETVAR ADDXL_OK 0
         TELL !WHO2TELL ADDXL O!"PGM".!"OBJ" 2 XL.!"OBJ" failed.
         IF  LKEDCMD = 1112 OR LKEDCMD = 1106
             SET STDLIST=SAVE
             TELL !WHO2TELL Can't open XL.!EXE
             SETVAR ADDXL_OK 0
             SETVAR SAVESPOOLFILE 'Y'
             EOJ
         ENDIF
     ENDIF
  UNLOCKFL

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

ATOM RSS1 RSS2