User Tools

Site Tools


cdc:nos2.source:nam5871:ssswnr

SSSWNR

Table Of Contents

  • [00003] PROC SSSWNR
  • [00004] SSSWNR - WAIT NEW REQUEST.
  • [00008] WAIT NEW REQUEST.
  • [00035] PROC NETWAIT
  • [00036] PROC RECALL
  • [00037] PROC RTIME
  • [00038] PROC SSTDFL

Source Code

SSSWNR.txt
  1. *DECK SSSWNR
  2. USETEXT TEXTSS
  3. PROC SSSWNR;
  4. # TITLE SSSWNR - WAIT NEW REQUEST. #
  5.  
  6. BEGIN # SSSWNR #
  7. #
  8. ** SSSWNR - WAIT NEW REQUEST.
  9. *
  10. * S. H. FISCHER. 81/08/27.
  11. * D. K. ENDO 82/04/22.
  12. * C. J. BRION 83/06/06.
  13. *
  14. * THIS ROUTINE IS CALLED WHEN NO WORK IS AVAILABLE.
  15. * IT DETERMINES IF THE PROGRAM SHOULD ROLLOUT (NETWAIT)
  16. * OR JUST GO INTO PERIODIC RECALL.
  17. *
  18. * PROC SSSWNR
  19. *
  20. * ENTRY 1. NONE.
  21. *
  22. * EXIT 1. NONE.
  23. *
  24. *
  25. #
  26.  
  27.  
  28.  
  29.  
  30. #
  31. **** PROC SSSWNR XREF LIST.
  32. #
  33. XREF
  34. BEGIN
  35. PROC NETWAIT; # REQUESTS NAM TO ROLLOUT #
  36. PROC RECALL; # PLACE PROGRAM IN RECALL STATUS #
  37. PROC RTIME; # GET REAL TIME FROM SYSTEM #
  38. PROC SSTDFL; # DECREASE FIELD LENGTH #
  39. END
  40. #
  41. ****
  42. #
  43.  
  44.  
  45. ITEM FOUND B; # FLAG SET IF A COMPLETE BIT IS NOT SET #
  46. ITEM I; # LOOP INDUCTION VARIABLE #
  47. ITEM WAIT; # COMPUTED MAXIMUM ROLLOUT TIME #
  48. ITEM TEMPI U; # TEMPORARY UNSIGNED INTEGER FOR TIMESTAMP#
  49. ARRAY TT$SWAPW[00:00] S(1);
  50. BEGIN
  51. ITEM TT$TSEC U(00,00,24); # REAL TIME IN SECONDS #
  52. ITEM TT$MILLI U(00,24,36); # REAL TIME IN MILLISECONDS #
  53. ITEM TT$TWORD U(00,00,60);
  54. END
  55.  
  56. #
  57.   THIS BASED ARRAY POINTS TO THE WORD CONTAINING THE COMPLETE BIT
  58.   THAT IS TO BE CHECKED.
  59. #
  60. BASED ARRAY COMP$WORD [00:00] S(1);
  61. BEGIN
  62. ITEM CW$WORD U(00,00,60);
  63. END
  64. CONTROL EJECT;
  65. # #
  66. # SSSWNR CODE BEGINS HERE #
  67. # #
  68. #
  69. * IF THE NEXT FIRE TIME IS LESS THAN THE MINIMUM ROLLOUT TIME PLUS
  70. * THE CURRENT TIME, THEN GO INTO RECALL, ELSE IF THE OVERLAY
  71. * REQUEST COUNTER IS NONE ZERO THEN GO INTO RECALL, ELSE USING THE
  72. * ROLLOUT TABLE CHECK IF THERE ARE ANY OUTSTANDING EXTERVAL REQUESTS
  73. * IF THERE IS, THEN GO INTO RECALL, ELSE DECREASE THE FIELD LENGTH
  74. * TO A MINIMUM, CALCULATE THE ROLLOUT
  75. * PERIOD BY SUBTRACTING THE NEXT FIRE TIME FROM THE CURRENT TIME AND
  76. * CALL NAM TO ROLL US OUT.
  77. *
  78. #
  79.  
  80. $BEGIN # INCREMENT COUNT FOR STATISTICS #
  81. SVT$VAL[SVL"WNR"] = SVT$VAL[SVL"WNR"] + 1;
  82. $END
  83.  
  84.  
  85. IF CTM$FTIME[0] LS (CTM$RTSEC[0] + MRT)
  86. THEN
  87. BEGIN
  88. RECALL(0);
  89. END
  90.  
  91.  
  92. ELSE IF ORC NQ 0
  93. THEN
  94. BEGIN
  95. RECALL(0);
  96. END
  97.  
  98.  
  99. ELSE
  100. BEGIN
  101. FOUND = FALSE;
  102. FOR I=1 STEP 1 WHILE NOT FOUND AND
  103. I LQ RT$EC[0]
  104. DO
  105. BEGIN
  106. P<COMP$WORD> = RT$WADD[I];
  107. IF B<RT$BPOS[I],1>CW$WORD[0] EQ 0
  108. THEN
  109. BEGIN
  110. FOUND = TRUE;
  111. END
  112. END
  113. IF FOUND
  114. THEN
  115. BEGIN
  116. RECALL(0);
  117. END
  118.  
  119.  
  120. ELSE
  121. BEGIN
  122. SSTDFL;
  123. WAIT = CTM$FTIME[0] - CTM$RTSEC[0];
  124.  
  125. #
  126. * IF FORCED ROLL OF PROGRAM CONDITION EXISTS, ISSUE FORCED NETWAIT
  127. * CALL FOR MFRT$ PERIOD OF TIME. OTHERWISE ISSUE NORMAL NETWAIT CALL
  128. * THAT WILL CAUSE ROLLOUT ONLY IF INPUT AVAILABLE NOT INDICATED BY
  129. * THE AIP NSUP WORD.
  130. #
  131.  
  132. IF PGM$FOROLL[0]
  133. THEN
  134. BEGIN
  135. WAIT = MFRT$;
  136. PGM$FOROLL[0] = FALSE;
  137. NETWAIT(WAIT,TRUE); # FORCED ROLLOUT #
  138. END
  139. ELSE
  140. BEGIN
  141. RTIME(TT$SWAPW); # GET REAL TIME #
  142. IF TT$TSEC[0] GQ SS$TSEC[0]
  143. THEN
  144. BEGIN
  145. TEMPI = TT$TSEC[0]*1000 + TT$MILLI[0] -
  146. SS$TSEC[0]*1000 - SS$TMILLI[0];
  147. END
  148. ELSE
  149. BEGIN # SECONDS COUNTER OVERFLOWED #
  150. TEMPI = SWAP$DELAY + 1;
  151. END
  152. IF TEMPI GR SWAP$DELAY # IF GREATER THAN DELAY TIME #
  153. THEN
  154. BEGIN
  155. SS$TWORD[0] = 0; # CLEAR TIMESTAMP #
  156. NETWAIT(WAIT,FALSE); # ROLLOUT ONLY IF NO INPUT #
  157. IF NOT (NSUP$DAIN OR NSUP$SMIN)
  158. THEN
  159. BEGIN # FREE CPU IF NO MSGS PENDING #
  160. RECALL(0);
  161. END
  162. END
  163. END
  164. END
  165. END
  166.  
  167.  
  168. RETURN; # **** RETURN **** #
  169. END # SSSWNR #
  170.  
  171. TERM
cdc/nos2.source/nam5871/ssswnr.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator