C+ C #.# C C C C Program Run Task (RUNNER) C C C FUNCTION: C This program processes all program activation requests C that have been queued via SNDPRM. C C C PROGRAM EXECUTION REQUIREMENTS: C RUNNER is activated initially by a 'run' command. C Thereafter, RUNNER fetches data from the 'runner' pipe C via the variable send data driver for parameter passing C (logical device XX:). C C SUBROUTINES REFERENCED: C WTQIO BUGMSG SYSMSG C GETADR TINFO ADDINS CHKINS C WTEXIT ABOAST C C DESCRIPTION: C This program is used to dequeue packets from the program activation C pipe ('RUNNER') and process the request accordingly. RUNNER checks C if the task is installed by scanning the TCB's in the system. C If the task is currently not installed, the request is passed C to 'INSREM' which handles flying installs. C C RUNNER will create the programs queue if not present, queue the C 3 word packet (if parameters are passed), then activate the task. C C C C SPECIAL CONSIDERATIONS: C C 1. RUNNER is a privleged program since it scans the TCB's C in executive pool space. C C 2. RUNNER must be run at priority above all tasks it activates C (180.) C C 3. RUNNER requires two logical devices: C XX0: = pipe device (variable send data driver) C (VX or VS) C BG0: = bug message device (TT: or NL:) C C 4. Parameter 'MAXTSK' must be changed if more than 256 C unique tasks are to be activated. C C- program runner implicit integer(a-z) parameter MAXTSK = 256 parameter QUELUN = 2 parameter MAXPRM = 100 parameter IBUFSZ = MAXPRM + 4 integer*4 inslst(MAXTSK) dimension ibuf(IBUFSZ), tbuf(4) dimension rcvnam(2), quenam(2), insnam(2) dimension isb(2), prl(6), iofnc(4) equivalence (rcvnam(1), ibuf(3)) equivalence (iocrq, iofnc(1)) equivalence (iowlb, iofnc(2)) equivalence (iorlb, iofnc(3)) equivalence (ioraw, iofnc(4)) data insnam /3rINS, 3rREM/ data quenam /3rRUN, 3rNER/ data iofnc / 1280, 256, 512, 640 / c c Assign the pipe LUN (XX0:) to 'QUELUN'; c create the RUNNER queue; c c 1 continue call ASNLUN (QUELUN, 'XX', 0) prl(3) = quenam(1) prl(4) = quenam(2) call GETADR (prl, ibuf) call WTQIO ( iocrq, QUELUN, 1, pri, isb, prl, ids) if (isb(1) .eq. 1 .or. isb(1) .eq. -102) go to 100 error = IOR (isb(1), "177400) 40 continue call SYSMSG ('Cannot create runner queue. error = ', error) call EXIT 90 continue error = IOR (isb(1), "177400) call SYSMSG ('error from VX: isb = ', error, isb(2)) 100 continue prl(2) = IBUFSZ * 2 prl(3) = quenam(1) prl(4) = quenam(2) call GETADR (prl, ibuf) call WTQIO ( ioraw, QUELUN, 1, pri, isb, prl, ids) C C Something in receive queue; C process it. C make sure status and count is valid. C 110 continue insflg = 0 call BUGMSG ('runner request.') if (isb(1) .ne. 1 .or. isb(2) .lt. 4) go to 90 size = isb(2) - 4 tsksts = TINFO (rcvnam, tbuf, 0) call BUGMSG ('task status = ', tsksts) c c Check if task is not installed or exiting; c which will send request to INSREM. c if (tsksts .eq. -1) call WTEXIT (rcvnam, tsksts) if (tsksts .ne. 0) go to 120 insflg = 1 if (CHKINS (rcvnam, inslst, maxtsk) .eq. 0) * index = ADDINS (rcvnam, inslst, maxtsk) go to 130 120 continue insflg = CHKINS (rcvnam, inslst, maxtsk) 130 continue if (insflg .eq. 0)go to 140 c c Task not installed, send request to INSREM. c prl(2) = size prl(3) = insnam(1) prl(4) = insnam(2) call GETADR (prl, ibuf(3)) do 135 i=1,3 call WTQIO ( iowlb, QUELUN, 1, pri, isb, prl, ids) if (isb(1) .eq. 1)go to 200 error = IOR(isb(1), "177400) if (error .ne. -103) go to 136 call mark (1, 5, 2) call stopfr (1) 135 continue 136 continue call SYSMSG ('Could not send request to INSREM ', error) go to 200 c c if no parameters, just activate it. c 140 continue if (size .eq. 4) go to 180 prl(2) = size - 2 prl(3) = rcvnam(1) prl(4) = rcvnam(2) ibuf(4) = 0 call GETADR (prl, ibuf(4)) 150 continue c c Try to queue parameters to the task; c create the queue if not present; c if queue full wait then try again. c (up to 3 times). c do 175 i=1,3 call WTQIO ( iowlb, QUELUN, 1, pri, isb, prl, ids) if (isb(1) .eq. 1)go to 180 if (isb(1) .eq. -101) then call BUGMSG ('Creating a task queue.') call WTQIO ( iocrq, QUELUN, 2, pri, isb, prl, ids) if (isb(1) .eq. 1) go to 150 endif error = IOR (isb(1), "177400) if (error .ne. -103) go to 176 call mark (1, 5, 2) call stopfr (1) 175 continue 176 continue call SYSMSG ('Could not send parameters to task. ',error) 180 continue if (tsksts .ne. 1) go to 200 call REQUES (prl(3), opt, ids) if (ids .ne. 1) call SYSMSG ('Error in activating task. ',ids) 200 continue go to 100 end