home *** CD-ROM | disk | FTP | other *** search
/ Programmer's ROM - The Computer Language Library / programmersrom.iso / ada / test / sritests.doc < prev    next >
Encoding:
Text File  |  1988-05-03  |  103.5 KB  |  4,935 lines

  1.  
  2.  
  3.  
  4.     PERFORMANCE TESTING OF SOME ADA PROGRAMMING CONTRUCTS
  5.  
  6. SRI is developing a packet switched network node, using the Ada
  7. programming language, and using the SUN Microsystem processor board as
  8. the target hardware, which contains a MC68000.  We have run some timing
  9. measurements on specially written Ada test programs in order to
  10. determine how to optimally use tasking, rendevous, selects, and
  11. parameter passing, and also to make an early prediction on the
  12. packet-per-second throughput of the system.
  13.  
  14. The test were compiled with the Telesoft Ada Compiler on a Diskless SUN
  15. Workstation, running UNIX 4.1c bsd.  The workstation was configured
  16. with 2 megabytes of local memory, and only a single user was logged in.
  17.  
  18. When the Run command is given to start the Ada program, it takes about
  19. 5 seconds for the run-time support environment to be loaded to the
  20. diskless sun.  Therefore timing is not started until a prompt from the
  21. program is answered by the user with a carriage return.  Timing is done
  22. manually with a stopwatch.  The program may optionally turn on
  23. printing, to check for deadlock situations, by answering the promt with
  24. a 'y' - this of course slows down the program, and these runs should
  25. not be used for performance measuring.
  26.  
  27. Most of the timings for each program were repeated 5 times, and the
  28. variance in time was seldom more than a second.  Timings given are the
  29. averages for multiple trials.
  30.  
  31. Following the times below is a summary of the program characteristics
  32. and the conclusions drawn from the tests.
  33.  
  34. program        cycles        seconds
  35. ________________________________________
  36. chain2        1000        3.57
  37. chain5        1000        10.15
  38. chain10        1000        19.66
  39. chain20        1000        38.03
  40.  
  41. idle1        10000        29.46
  42. idle5                -
  43. idle10                -
  44. idle20        10000        29.93
  45.  
  46. select2        1000        4.38
  47. select2e    1000        4.38
  48. select20    1000        8.42
  49. select20e    1000        8.33
  50.  
  51. guard2        1000        4.28
  52. guard2e        1000        4.22
  53. guard20        1000        6.20
  54. guard20e    1000        6.11
  55. guard20t    1000        8.31
  56. guard20et    1000        8.11
  57.  
  58. chain2n        10000        29.58
  59. chain2pkt    10000        29.77
  60. chain2ptr    10000        29.98
  61.  
  62. passarrys    10000        29.
  63. passarryb    10000        29.
  64. passinout    10000        29.
  65.  
  66. moretasks    1000        38.
  67. moretasksl    1000        47.
  68. moreselct    1000        128.
  69. moreselctr    1000        130.
  70.  
  71. order31        100        28.
  72. order31r    100        28.
  73. order32        compiles without errors, but crashes when run
  74. order100    compiles without errors, but crashes when run
  75.  
  76. DESCRIPTION OF TEST PROGRAMS AND RESULTS
  77.  
  78. CHAIN - TO DETERMINE OVERHEAD IN CONTEXTS SWITCHES BETWEEN TASKS
  79. Each chain task, within each cycle of the loop, calls an entry in the
  80. "next task" in a chain of tasks, the called entry contains a null
  81. statement and returns, and the tasks then waits to be called by another
  82. task at a similar entry of its own.  Thus each task is run in turn
  83. dependent on its position in the chain.  Chains of length 2, 5, 10, and
  84. 20 tasks were compared after 1000 complete cycles around the chain.
  85. Times recorded were
  86. chain2        1000        3.57
  87. chain5        1000        10.15
  88. chain10        1000        19.66
  89. chain20        1000        38.03
  90. Dividing these times by the number of tasks in each test yields
  91. respectively 1.78, 2.03, 1.96, and 1.90; dividing by the number of
  92. cycles then indicates that each context switch (rendezvous) costs about
  93. 2 millisec.
  94.  
  95. IDLE - DETERMINE WHETHER IDLE TASKS IMPACT PERFORMANCE
  96. A chain of length 2 as described above was cycled 10000 times, before
  97. the cycles are started, some number of "idle" task are called at an
  98. "init" entry and are then left waiting at a "never" entry which will
  99. never be called.  The timings for 1 and 20 idle task are recorded below
  100. idle1        10000        29.46
  101. idle5                -
  102. idle10                -
  103. idle20        10000        29.93
  104. Within the accuracy of the measurements, there is no difference
  105. in the timings, which implies that there is no performance penalty
  106. for increasing numbers of tasks waiting on a single entrys.
  107.  
  108. SELECT - DOES THE NUMBER OF SELECT CHOICES MATTER
  109. One task calls a single entry of a second task 1000 times, but
  110. the second task has a select statement encompassing some
  111. number of alternatives. The test was done for 2 and 20
  112. alternatives, with the desired entry being the first one
  113. in the select list, and repeated for the desired entry
  114. being at the end of the select list.
  115. select2        1000        4.38
  116. select2e    1000        4.38
  117. select20    1000        8.42
  118. select20e    1000        8.33
  119. These results show that large select statements are costly.
  120.  
  121. GUARDS - DO GUARDS ON ENTRY STATEMENTS IMPACT PERFORMANCE
  122. The select tests above were repeated with boolean guards placed
  123. in front of all the entry choices.  In some cases, only the 
  124. guard on the entry which would really be called was true, and
  125. all of the other guards were false.  In other cases, all of the
  126. guards were set to true.
  127. guard2        1000        4.28
  128. guard2e        1000        4.22
  129. guard20        1000        6.20
  130. guard20e    1000        6.11
  131. guard20t    1000        8.31
  132. guard20et    1000        8.11
  133. Comparing these results with the previous tests, it appears that
  134. the cost of using guards on select entrys is very small. 
  135. A guard which evaluates to false apparently significantly reduces the overhead
  136. of evaluating the guarded select.
  137.  
  138. PARAMETERS - WHAT IS THE IMPACT OF PASSING PARAMETERS IN RENDEVOUS
  139. The following chain test were run passing "no" parameters, passing
  140. a packet record as a parameter, and passing a pointer to a record.
  141. chain2n        10000        29.58
  142. chain2pkt    10000        29.77
  143. chain2ptr    10000        29.98
  144. The results show the there is no measurable cost in using entry parameters.
  145.  
  146. PARAMETER SIZE - DOES SIZE OF THE PASSED PARAMETER MAKE A DIFFERENCE
  147. The above test was repeated with a parameters as follows. A "in"
  148. small integer array of length 2, an "in" integer array length 32000,
  149. and an "in out" integer array length 32000.
  150. passarrys    10000        29.
  151. passarryb    10000        29.
  152. passinout    10000        29.
  153. There is no observed cost in using large structures as parameters.
  154.  
  155. TASKS - IS IT BETTER TO HAVE LOTS OF LITTLE TASKS WITH SINGLE ENTRY CHOICES
  156.     OR FEW BIG TASKS WITH MANY SELECT CHOICES
  157. Some of the previous results would imply the use of many tasks.
  158. In the "moretasks" tests, a master tasks calls each of 20 slave tasks,
  159. each with a single entry. In "moretasksl" each task again has a single
  160. entry, but it is embedded in a select statement for fair comparison
  161. to the next test.  In "moreselct" a master task calls each of the 20
  162. entrys in a single slave task, and the slave task has the 20 entrys
  163. embedded in a large select statement.  In the "moreselctr" the 20
  164. entrys are listed in the opposite order to which the master calls them.
  165. moretasks    1000        38.
  166. moretasksl    1000        47.
  167. moreselct    1000        128.
  168. moreselctr    1000        130.
  169. The results suggest to use lots of tasks with few select choices.
  170.  
  171. ORDER - DOES ORDERING OF ENTRY CLAUSES IN A SELECT MATTER
  172. The "moreselct" test was modified by increasing the number of
  173. entry clauses to 100.  However it was discovered that a
  174. select statement can only contain a maximum of 31 choices.
  175. Then the program was run for 100 cycles. Another test was
  176. run calling the entrys in the reverse of the select statement.
  177. order31        100        28.
  178. order31r    100        28.
  179. order32        compiles without errors, but crashes when run
  180. order100    compiles without errors, but crashes when run
  181. No difference was determined, however if a large select clause
  182. were permitted (100 entries) it may have suggested which ordering
  183. was optimal.
  184.  
  185. SCHEDTEST - DETERMINE WHETHER THE ADA SCHEDULER MAY STARVE A TASK
  186.  
  187. A slave task with a two entry select statement is used independently by
  188. three other tasks.  The test is run until the slave has been called
  189. 1000 times.  Two of the tasks call the first entry, and the third task
  190. calls the second slave entry.  Each task, and the slave have print
  191. statements to help determine which task is running.  The order and
  192. relative frequency of the tasks printout will show whether any of the
  193. task are starved or run more often than the others.  When the test was
  194. run, it was seen that the three tasks alternately print their rendezous
  195. annoucement once each.  Thus, none of the tasks were starved, and
  196. rescheduling apparently occurs with the frequency of one rendezous.
  197.  
  198.  
  199. CONCLUSIONS
  200. The overhead of a rendevous or task context switch takes 1 - 2 millisecs.
  201. The number of idle tasks waiting on uncalled entries, do not impact speed.
  202. The number of entrys in a select significantly impacts selection speed.
  203. Evaluation of "when" clauses is quick, and when false, prevent the
  204.     long select evaluation time, speeding the system.
  205. Passing parameters in rendezous is quick, and there is not much difference
  206.     on parameter size or whether "in" or "in out".
  207. The ordering of entrys in a select clause in not important.
  208. To build an optimized system, use more tasks, each with less number
  209.     of entries in select clauses, and use guards.
  210.  
  211. CAUTIONS
  212. Array index are apparently limited to 32000 elements.
  213. Selects may have no more than 31 possible entries.
  214.  
  215. TELESOFT COMPILER LIMITATIONS
  216.  
  217. The Telesoft Ada Compiler that we have used for performing these
  218. benchmarks is not a complete implementation of the language.  Telesoft
  219. is currently in the process of validating their full Ada compiler, and
  220. we will then get an update with the full language implemented.  Some of
  221. the deficiencies of the language, which affected our selection of
  222. benchmarks and programming style, are generics, subunits, some pragmas,
  223. representation specifications, tasks types, entry families, timed entry
  224. calls and the calendar package, and the abort statement.
  225.  
  226. SUGGESTIONS FOR FURTHER ADA BENCHMARK STUDIES
  227.  
  228. Most of the test which we performed were concerned with determining how
  229. to optimize task and select statement organization.  However, it is
  230. important to understand many of the other facilites of the rich
  231. language, some of which are not yet implemented in our compiler.
  232. Particularly in our application of a real time packet switching node,
  233. we should study the performance of representation specifications, low
  234. level input/output, the timing facilities, aborts, and interrupt
  235. handling.
  236.  
  237.  
  238.  
  239.  
  240. **********************************************************************
  241. *                            NEXT PROGRAM                            *
  242. **********************************************************************
  243.  
  244.  
  245. ***** CHAIN2 *****
  246.  
  247. -- ada tasking tester
  248. -- task head is the controller
  249. -- tasks link are the chain of tasks
  250. -- tasks idle are the standby tasks
  251.  
  252. with text_io; use text_io;
  253.  
  254. procedure test is
  255.     cycles: integer;
  256.     printon: boolean;
  257.     answer: character;
  258.  
  259.     task head is
  260.         entry give;
  261.     end head;
  262.  
  263.     task link1 is
  264.         entry give;
  265.     end link1;
  266.  
  267.     task body head is
  268.         begin
  269.             put("do you want printing (y/n)? ");
  270.             get(answer);
  271.     put("answer is "); put(answer); put_line(" ");
  272.             if answer='y' then
  273.                 printon := true;
  274.             else
  275.                 printon := false;
  276.             end if;
  277.     if printon then put_line("printing on"); else put_line("print off");
  278.     end if;
  279.             put("how many cycles? ");
  280. -- doesn't work            get_line(cycles);
  281.             cycles := 1000;
  282.  
  283.             put_line("started");
  284.             for i in 1..cycles loop
  285.                 if printon then put_line("head"); end if;
  286.                 link1.give;
  287.                 accept give do 
  288.                     null;
  289.                 end give;
  290.             end loop;
  291.             put_line("ended");
  292.         end head;
  293.  
  294.     task body link1 is
  295.         begin
  296.             loop
  297.                 accept give do 
  298.                         null;
  299.                 end give;
  300.                 if printon then put_line("link1"); end if;
  301.                 head.give;
  302.             end loop;
  303.         end link1;
  304.  
  305.  
  306. begin
  307.     null;
  308. end test;
  309.  
  310.  
  311. **********************************************************************
  312. *                            NEXT PROGRAM                            *
  313. **********************************************************************
  314.  
  315.  
  316. ***** CHAIN5 *****
  317.  
  318. -- ada tasking tester
  319. -- task head is the controller
  320. -- tasks link are the chain of tasks
  321. -- tasks idle are the standby tasks
  322.  
  323. with text_io; use text_io;
  324.  
  325. procedure test is
  326.     cycles: integer;
  327.     printon: boolean;
  328.     answer: character;
  329.  
  330.     task head is
  331.         entry give;
  332.     end head;
  333.  
  334.     task link2 is
  335.         entry give;
  336.     end link2;
  337.  
  338.     task link3 is
  339.         entry give;
  340.     end link3;
  341.  
  342.     task link4 is
  343.         entry give;
  344.     end link4;
  345.  
  346.     task link5 is
  347.         entry give;
  348.     end link5;
  349.  
  350.     task body head is
  351.         begin
  352.             put("do you want printing (y/n)? ");
  353.             get(answer);
  354.     put("answer is "); put(answer); put_line(" ");
  355.             if answer='y' then
  356.                 printon := true;
  357.             else
  358.                 printon := false;
  359.             end if;
  360.     if printon then put_line("printing on"); else put_line("print off");
  361.     end if;
  362.             put("how many cycles? ");
  363. -- doesn't work            get_line(cycles);
  364.             cycles := 1000;
  365.  
  366.             put_line("started");
  367.             for i in 1..cycles loop
  368.                 if printon then put_line("head"); end if;
  369.                 link2.give;
  370.                 accept give do 
  371.                     null;
  372.                 end give;
  373.             end loop;
  374.             put_line("ended");
  375.         end head;
  376.  
  377.     task body link2 is
  378.         begin
  379.             loop
  380.                 accept give do 
  381.                         null;
  382.                 end give;
  383.                 if printon then put_line("link2"); end if;
  384.                 link3.give;
  385.             end loop;
  386.         end link2;
  387.  
  388.     task body link3 is
  389.         begin
  390.             loop
  391.                 accept give do 
  392.                         null;
  393.                 end give;
  394.                 if printon then put_line("link3"); end if;
  395.                 link4.give;
  396.             end loop;
  397.         end link3;
  398.  
  399.     task body link4 is
  400.         begin
  401.             loop
  402.                 accept give do 
  403.                         null;
  404.                 end give;
  405.                 if printon then put_line("link4"); end if;
  406.                 link5.give;
  407.             end loop;
  408.         end link4;
  409.  
  410.     task body link5 is
  411.         begin
  412.             loop
  413.                 accept give do 
  414.                         null;
  415.                 end give;
  416.                 if printon then put_line("link5"); end if;
  417.                 head.give;
  418.             end loop;
  419.         end link5;
  420.  
  421.  
  422. begin
  423.     null;
  424. end test;
  425.  
  426.  
  427. **********************************************************************
  428. *                            NEXT PROGRAM                            *
  429. **********************************************************************
  430.  
  431.  
  432. ***** CHAIN10 *****
  433.  
  434. -- ada tasking tester
  435. -- task head is the controller
  436. -- tasks link are the chain of tasks
  437. -- tasks idle are the standby tasks
  438.  
  439. with text_io; use text_io;
  440.  
  441. procedure test is
  442.     cycles: integer;
  443.     printon: boolean;
  444.     answer: character;
  445.  
  446.     task head is
  447.         entry give;
  448.     end head;
  449.  
  450.     task link2 is
  451.         entry give;
  452.     end link2;
  453.  
  454.     task link3 is
  455.         entry give;
  456.     end link3;
  457.  
  458.     task link4 is
  459.         entry give;
  460.     end link4;
  461.  
  462.     task link5 is
  463.         entry give;
  464.     end link5;
  465.  
  466.     task link11 is
  467.         entry give;
  468.     end link11;
  469.  
  470.     task link12 is
  471.         entry give;
  472.     end link12;
  473.  
  474.     task link13 is
  475.         entry give;
  476.     end link13;
  477.  
  478.     task link14 is
  479.         entry give;
  480.     end link14;
  481.  
  482.     task link15 is
  483.         entry give;
  484.     end link15;
  485.  
  486.     task body head is
  487.         begin
  488.             put("do you want printing (y/n)? ");
  489.             get(answer);
  490.     put("answer is "); put(answer); put_line(" ");
  491.             if answer='y' then
  492.                 printon := true;
  493.             else
  494.                 printon := false;
  495.             end if;
  496.     if printon then put_line("printing on"); else put_line("print off");
  497.     end if;
  498.             put("how many cycles? ");
  499. -- doesn't work            get_line(cycles);
  500.             cycles := 1000;
  501.  
  502.             put_line("started");
  503.             for i in 1..cycles loop
  504.                 if printon then put_line("head"); end if;
  505.                 link2.give;
  506.                 accept give do 
  507.                     null;
  508.                 end give;
  509.             end loop;
  510.             put_line("ended");
  511.         end head;
  512.  
  513.     task body link2 is
  514.         begin
  515.             loop
  516.                 accept give do 
  517.                         null;
  518.                 end give;
  519.                 if printon then put_line("link2"); end if;
  520.                 link3.give;
  521.             end loop;
  522.         end link2;
  523.  
  524.     task body link3 is
  525.         begin
  526.             loop
  527.                 accept give do 
  528.                         null;
  529.                 end give;
  530.                 if printon then put_line("link3"); end if;
  531.                 link4.give;
  532.             end loop;
  533.         end link3;
  534.  
  535.     task body link4 is
  536.         begin
  537.             loop
  538.                 accept give do 
  539.                         null;
  540.                 end give;
  541.                 if printon then put_line("link4"); end if;
  542.                 link5.give;
  543.             end loop;
  544.         end link4;
  545.  
  546.     task body link5 is
  547.         begin
  548.             loop
  549.                 accept give do 
  550.                         null;
  551.                 end give;
  552.                 if printon then put_line("link5"); end if;
  553.                 link11.give;
  554.             end loop;
  555.         end link5;
  556.  
  557.     task body link11 is
  558.         begin
  559.             loop
  560.                 accept give do 
  561.                         null;
  562.                 end give;
  563.                 if printon then put_line("link11"); end if;
  564.                 link12.give;
  565.             end loop;
  566.         end link11;
  567.  
  568.     task body link12 is
  569.         begin
  570.             loop
  571.                 accept give do 
  572.                         null;
  573.                 end give;
  574.                 if printon then put_line("link12"); end if;
  575.                 link13.give;
  576.             end loop;
  577.         end link12;
  578.  
  579.     task body link13 is
  580.         begin
  581.             loop
  582.                 accept give do 
  583.                         null;
  584.                 end give;
  585.                 if printon then put_line("link13"); end if;
  586.                 link14.give;
  587.             end loop;
  588.         end link13;
  589.  
  590.     task body link14 is
  591.         begin
  592.             loop
  593.                 accept give do 
  594.                         null;
  595.                 end give;
  596.                 if printon then put_line("link14"); end if;
  597.                 link15.give;
  598.             end loop;
  599.         end link14;
  600.  
  601.     task body link15 is
  602.         begin
  603.             loop
  604.                 accept give do 
  605.                         null;
  606.                 end give;
  607.                 if printon then put_line("link15"); end if;
  608.                 head.give;
  609.             end loop;
  610.         end link15;
  611.  
  612.  
  613. begin
  614.     null;
  615. end test;
  616.  
  617.  
  618. **********************************************************************
  619. *                            NEXT PROGRAM                            *
  620. **********************************************************************
  621.  
  622.  
  623. ***** CHAIN20 *****
  624.  
  625. -- ada tasking tester
  626. -- task head is the controller
  627. -- tasks link are the chain of tasks
  628. -- tasks idle are the standby tasks
  629.  
  630. with text_io; use text_io;
  631.  
  632. procedure test is
  633.     cycles: integer;
  634.     printon: boolean;
  635.     answer: character;
  636.  
  637.     task head is
  638.         entry give;
  639.     end head;
  640.  
  641.     task link2 is
  642.         entry give;
  643.     end link2;
  644.  
  645.     task link3 is
  646.         entry give;
  647.     end link3;
  648.  
  649.     task link4 is
  650.         entry give;
  651.     end link4;
  652.  
  653.     task link5 is
  654.         entry give;
  655.     end link5;
  656.  
  657.     task link11 is
  658.         entry give;
  659.     end link11;
  660.  
  661.     task link12 is
  662.         entry give;
  663.     end link12;
  664.  
  665.     task link13 is
  666.         entry give;
  667.     end link13;
  668.  
  669.     task link14 is
  670.         entry give;
  671.     end link14;
  672.  
  673.     task link15 is
  674.         entry give;
  675.     end link15;
  676.  
  677.     task link21 is
  678.         entry give;
  679.     end link21;
  680.  
  681.     task link22 is
  682.         entry give;
  683.     end link22;
  684.  
  685.     task link23 is
  686.         entry give;
  687.     end link23;
  688.  
  689.     task link24 is
  690.         entry give;
  691.     end link24;
  692.  
  693.     task link25 is
  694.         entry give;
  695.     end link25;
  696.  
  697.     task link211 is
  698.         entry give;
  699.     end link211;
  700.  
  701.     task link212 is
  702.         entry give;
  703.     end link212;
  704.  
  705.     task link213 is
  706.         entry give;
  707.     end link213;
  708.  
  709.     task link214 is
  710.         entry give;
  711.     end link214;
  712.  
  713.     task link215 is
  714.         entry give;
  715.     end link215;
  716.  
  717.     task body head is
  718.         begin
  719.             put("do you want printing (y/n)? ");
  720.             get(answer);
  721.     put("answer is "); put(answer); put_line(" ");
  722.             if answer='y' then
  723.                 printon := true;
  724.             else
  725.                 printon := false;
  726.             end if;
  727.     if printon then put_line("printing on"); else put_line("print off");
  728.     end if;
  729.             put("how many cycles? ");
  730. -- doesn't work            get_line(cycles);
  731.             cycles := 1000;
  732.  
  733.             put_line("started");
  734.             for i in 1..cycles loop
  735.                 if printon then put_line("head"); end if;
  736.                 link2.give;
  737.                 accept give do 
  738.                     null;
  739.                 end give;
  740.             end loop;
  741.             put_line("ended");
  742.         end head;
  743.  
  744.     task body link2 is
  745.         begin
  746.             loop
  747.                 accept give do 
  748.                         null;
  749.                 end give;
  750.                 if printon then put_line("link2"); end if;
  751.                 link3.give;
  752.             end loop;
  753.         end link2;
  754.  
  755.     task body link3 is
  756.         begin
  757.             loop
  758.                 accept give do 
  759.                         null;
  760.                 end give;
  761.                 if printon then put_line("link3"); end if;
  762.                 link4.give;
  763.             end loop;
  764.         end link3;
  765.  
  766.     task body link4 is
  767.         begin
  768.             loop
  769.                 accept give do 
  770.                         null;
  771.                 end give;
  772.                 if printon then put_line("link4"); end if;
  773.                 link5.give;
  774.             end loop;
  775.         end link4;
  776.  
  777.     task body link5 is
  778.         begin
  779.             loop
  780.                 accept give do 
  781.                         null;
  782.                 end give;
  783.                 if printon then put_line("link5"); end if;
  784.                 link11.give;
  785.             end loop;
  786.         end link5;
  787.  
  788.     task body link11 is
  789.         begin
  790.             loop
  791.                 accept give do 
  792.                         null;
  793.                 end give;
  794.                 if printon then put_line("link11"); end if;
  795.                 link12.give;
  796.             end loop;
  797.         end link11;
  798.  
  799.     task body link12 is
  800.         begin
  801.             loop
  802.                 accept give do 
  803.                         null;
  804.                 end give;
  805.                 if printon then put_line("link12"); end if;
  806.                 link13.give;
  807.             end loop;
  808.         end link12;
  809.  
  810.     task body link13 is
  811.         begin
  812.             loop
  813.                 accept give do 
  814.                         null;
  815.                 end give;
  816.                 if printon then put_line("link13"); end if;
  817.                 link14.give;
  818.             end loop;
  819.         end link13;
  820.  
  821.     task body link14 is
  822.         begin
  823.             loop
  824.                 accept give do 
  825.                         null;
  826.                 end give;
  827.                 if printon then put_line("link14"); end if;
  828.                 link15.give;
  829.             end loop;
  830.         end link14;
  831.  
  832.     task body link15 is
  833.         begin
  834.             loop
  835.                 accept give do 
  836.                         null;
  837.                 end give;
  838.                 if printon then put_line("link15"); end if;
  839.                 link21.give;
  840.             end loop;
  841.         end link15;
  842.  
  843.     task body link21 is
  844.         begin
  845.             loop
  846.                 accept give do 
  847.                         null;
  848.                 end give;
  849.                 if printon then put_line("link21"); end if;
  850.                 link22.give;
  851.             end loop;
  852.         end link21;
  853.  
  854.     task body link22 is
  855.         begin
  856.             loop
  857.                 accept give do 
  858.                         null;
  859.                 end give;
  860.                 if printon then put_line("link22"); end if;
  861.                 link23.give;
  862.             end loop;
  863.         end link22;
  864.  
  865.     task body link23 is
  866.         begin
  867.             loop
  868.                 accept give do 
  869.                         null;
  870.                 end give;
  871.                 if printon then put_line("link23"); end if;
  872.                 link24.give;
  873.             end loop;
  874.         end link23;
  875.  
  876.     task body link24 is
  877.         begin
  878.             loop
  879.                 accept give do 
  880.                         null;
  881.                 end give;
  882.                 if printon then put_line("link24"); end if;
  883.                 link25.give;
  884.             end loop;
  885.         end link24;
  886.  
  887.     task body link25 is
  888.         begin
  889.             loop
  890.                 accept give do 
  891.                         null;
  892.                 end give;
  893.                 if printon then put_line("link25"); end if;
  894.                 link211.give;
  895.             end loop;
  896.         end link25;
  897.  
  898.     task body link211 is
  899.         begin
  900.             loop
  901.                 accept give do 
  902.                         null;
  903.                 end give;
  904.                 if printon then put_line("link211"); end if;
  905.                 link212.give;
  906.             end loop;
  907.         end link211;
  908.  
  909.     task body link212 is
  910.         begin
  911.             loop
  912.                 accept give do 
  913.                         null;
  914.                 end give;
  915.                 if printon then put_line("link212"); end if;
  916.                 link213.give;
  917.             end loop;
  918.         end link212;
  919.  
  920.     task body link213 is
  921.         begin
  922.             loop
  923.                 accept give do 
  924.                         null;
  925.                 end give;
  926.                 if printon then put_line("link213"); end if;
  927.                 link214.give;
  928.             end loop;
  929.         end link213;
  930.  
  931.     task body link214 is
  932.         begin
  933.             loop
  934.                 accept give do 
  935.                         null;
  936.                 end give;
  937.                 if printon then put_line("link214"); end if;
  938.                 link215.give;
  939.             end loop;
  940.         end link214;
  941.  
  942.     task body link215 is
  943.         begin
  944.             loop
  945.                 accept give do 
  946.                         null;
  947.                 end give;
  948.                 if printon then put_line("link215"); end if;
  949.                 head.give;
  950.             end loop;
  951.         end link215;
  952.  
  953.  
  954. begin
  955.     null;
  956. end test;
  957.  
  958.  
  959. **********************************************************************
  960. *                            NEXT PROGRAM                            *
  961. **********************************************************************
  962.  
  963.  
  964. ***** IDLE1 *****
  965.  
  966. -- ada tasking tester
  967. -- task head is the controller
  968. -- tasks link are the chain of tasks
  969. -- tasks idle are the standby tasks
  970.  
  971. with text_io; use text_io;
  972.  
  973. procedure test is
  974.     cycles: integer;
  975.     printon: boolean;
  976.     answer: character;
  977.  
  978.     task head is
  979.         entry give;
  980.     end head;
  981.  
  982.     task link1 is
  983.         entry give;
  984.     end link1;
  985.  
  986.     task idle1 is
  987.         entry init;
  988.         entry never;
  989.     end idle1;
  990.  
  991.     task body head is
  992.         begin
  993.             idle1.init;
  994.  
  995.             put("do you want printing (y/n)? ");
  996.             get(answer);
  997.     put("answer is "); put(answer); put_line(" ");
  998.             if answer='y' then
  999.                 printon := true;
  1000.             else
  1001.                 printon := false;
  1002.             end if;
  1003.     if printon then put_line("printing on"); else put_line("print off");
  1004.     end if;
  1005.             put("how many cycles? ");
  1006. -- doesn't work            get_line(cycles);
  1007.             cycles := 10000;
  1008.  
  1009.             put_line("started");
  1010.             for i in 1..cycles loop
  1011.                 if printon then put_line("head"); end if;
  1012.                 link1.give;
  1013.                 accept give do 
  1014.                     null;
  1015.                 end give;
  1016.             end loop;
  1017.             put_line("ended");
  1018.         end head;
  1019.  
  1020.     task body link1 is
  1021.         begin
  1022.             loop
  1023.                 accept give do 
  1024.                         null;
  1025.                 end give;
  1026.                 if printon then put_line("link1"); end if;
  1027.                 head.give;
  1028.             end loop;
  1029.         end link1;
  1030.  
  1031.     task body idle1 is
  1032.         begin 
  1033.             accept init do put_line("idle1"); end init;
  1034.             accept never do null; end never;
  1035.         end idle1;
  1036.  
  1037. begin
  1038.     null;
  1039. end test;
  1040.  
  1041.  
  1042. **********************************************************************
  1043. *                            NEXT PROGRAM                            *
  1044. **********************************************************************
  1045.  
  1046.  
  1047. ***** IDLE5 *****
  1048.  
  1049. -- ada tasking tester
  1050. -- task head is the controller
  1051. -- tasks link are the chain of tasks
  1052. -- tasks idle are the standby tasks
  1053.  
  1054. with text_io; use text_io;
  1055.  
  1056. procedure test is
  1057.     cycles: integer;
  1058.     printon: boolean;
  1059.     answer: character;
  1060.  
  1061.     task head is
  1062.         entry give;
  1063.     end head;
  1064.  
  1065.     task link1 is
  1066.         entry give;
  1067.     end link1;
  1068.  
  1069.     task idle1 is
  1070.         entry init;
  1071.         entry never;
  1072.     end idle1;
  1073.  
  1074.     task idle2 is
  1075.         entry init;
  1076.         entry never;
  1077.     end idle2;
  1078.  
  1079.     task idle3 is
  1080.         entry init;
  1081.         entry never;
  1082.     end idle3;
  1083.  
  1084.     task idle4 is
  1085.         entry init;
  1086.         entry never;
  1087.     end idle4;
  1088.  
  1089.     task idle5 is
  1090.         entry init;
  1091.         entry never;
  1092.     end idle5;
  1093.  
  1094.     task body head is
  1095.         begin
  1096.             idle1.init;
  1097.             idle2.init;
  1098.             idle3.init;
  1099.             idle4.init;
  1100.             idle5.init;
  1101.  
  1102.             put("do you want printing (y/n)? ");
  1103.             get(answer);
  1104.     put("answer is "); put(answer); put_line(" ");
  1105.             if answer='y' then
  1106.                 printon := true;
  1107.             else
  1108.                 printon := false;
  1109.             end if;
  1110.     if printon then put_line("printing on"); else put_line("print off");
  1111.     end if;
  1112.             put("how many cycles? ");
  1113. -- doesn't work            get_line(cycles);
  1114.             cycles := 10000;
  1115.  
  1116.             put_line("started");
  1117.             for i in 1..cycles loop
  1118.                 if printon then put_line("head"); end if;
  1119.                 link1.give;
  1120.                 accept give do 
  1121.                     null;
  1122.                 end give;
  1123.             end loop;
  1124.             put_line("ended");
  1125.         end head;
  1126.  
  1127.     task body link1 is
  1128.         begin
  1129.             loop
  1130.                 accept give do 
  1131.                         null;
  1132.                 end give;
  1133.                 if printon then put_line("link1"); end if;
  1134.                 head.give;
  1135.             end loop;
  1136.         end link1;
  1137.  
  1138.     task body idle1 is
  1139.         begin 
  1140.             accept init do put_line("idle1"); end init;
  1141.             accept never do null; end never;
  1142.         end idle1;
  1143.  
  1144.     task body idle2 is
  1145.         begin 
  1146.             accept init do put_line("idle2"); end init;
  1147.             accept never do null; end never;
  1148.         end idle2;
  1149.  
  1150.     task body idle3 is
  1151.         begin 
  1152.             accept init do put_line("idle3"); end init;
  1153.             accept never do null; end never;
  1154.         end idle3;
  1155.  
  1156.     task body idle4 is
  1157.         begin 
  1158.             accept init do put_line("idle4"); end init;
  1159.             accept never do null; end never;
  1160.         end idle4;
  1161.  
  1162.     task body idle5 is
  1163.         begin 
  1164.             accept init do put_line("idle5"); end init;
  1165.             accept never do null; end never;
  1166.         end idle5;
  1167.  
  1168. begin
  1169.     null;
  1170. end test;
  1171.  
  1172.  
  1173. **********************************************************************
  1174. *                            NEXT PROGRAM                            *
  1175. **********************************************************************
  1176.  
  1177.  
  1178. ***** IDLE10 *****
  1179.  
  1180. -- ada tasking tester
  1181. -- task head is the controller
  1182. -- tasks link are the chain of tasks
  1183. -- tasks idle are the standby tasks
  1184.  
  1185. with text_io; use text_io;
  1186.  
  1187. procedure test is
  1188.     cycles: integer;
  1189.     printon: boolean;
  1190.     answer: character;
  1191.  
  1192.     task head is
  1193.         entry give;
  1194.     end head;
  1195.  
  1196.     task link1 is
  1197.         entry give;
  1198.     end link1;
  1199.  
  1200.     task idle1 is
  1201.         entry init;
  1202.         entry never;
  1203.     end idle1;
  1204.  
  1205.     task idle2 is
  1206.         entry init;
  1207.         entry never;
  1208.     end idle2;
  1209.  
  1210.     task idle3 is
  1211.         entry init;
  1212.         entry never;
  1213.     end idle3;
  1214.  
  1215.     task idle4 is
  1216.         entry init;
  1217.         entry never;
  1218.     end idle4;
  1219.  
  1220.     task idle5 is
  1221.         entry init;
  1222.         entry never;
  1223.     end idle5;
  1224.  
  1225.     task idle11 is
  1226.         entry init;
  1227.         entry never;
  1228.     end idle11;
  1229.  
  1230.     task idle12 is
  1231.         entry init;
  1232.         entry never;
  1233.     end idle12;
  1234.  
  1235.     task idle13 is
  1236.         entry init;
  1237.         entry never;
  1238.     end idle13;
  1239.  
  1240.     task idle14 is
  1241.         entry init;
  1242.         entry never;
  1243.     end idle14;
  1244.  
  1245.     task idle15 is
  1246.         entry init;
  1247.         entry never;
  1248.     end idle15;
  1249.  
  1250.     task body head is
  1251.         begin
  1252.             idle1.init;
  1253.             idle2.init;
  1254.             idle3.init;
  1255.             idle4.init;
  1256.             idle5.init;
  1257.             idle11.init;
  1258.             idle12.init;
  1259.             idle13.init;
  1260.             idle14.init;
  1261.             idle15.init;
  1262.  
  1263.             put("do you want printing (y/n)? ");
  1264.             get(answer);
  1265.     put("answer is "); put(answer); put_line(" ");
  1266.             if answer='y' then
  1267.                 printon := true;
  1268.             else
  1269.                 printon := false;
  1270.             end if;
  1271.     if printon then put_line("printing on"); else put_line("print off");
  1272.     end if;
  1273.             put("how many cycles? ");
  1274. -- doesn't work            get_line(cycles);
  1275.             cycles := 10000;
  1276.  
  1277.             put_line("started");
  1278.             for i in 1..cycles loop
  1279.                 if printon then put_line("head"); end if;
  1280.                 link1.give;
  1281.                 accept give do 
  1282.                     null;
  1283.                 end give;
  1284.             end loop;
  1285.             put_line("ended");
  1286.         end head;
  1287.  
  1288.     task body link1 is
  1289.         begin
  1290.             loop
  1291.                 accept give do 
  1292.                         null;
  1293.                 end give;
  1294.                 if printon then put_line("link1"); end if;
  1295.                 head.give;
  1296.             end loop;
  1297.         end link1;
  1298.  
  1299.     task body idle1 is
  1300.         begin 
  1301.             accept init do put_line("idle1"); end init;
  1302.             accept never do null; end never;
  1303.         end idle1;
  1304.  
  1305.     task body idle2 is
  1306.         begin 
  1307.             accept init do put_line("idle2"); end init;
  1308.             accept never do null; end never;
  1309.         end idle2;
  1310.  
  1311.     task body idle3 is
  1312.         begin 
  1313.             accept init do put_line("idle3"); end init;
  1314.             accept never do null; end never;
  1315.         end idle3;
  1316.  
  1317.     task body idle4 is
  1318.         begin 
  1319.             accept init do put_line("idle4"); end init;
  1320.             accept never do null; end never;
  1321.         end idle4;
  1322.  
  1323.     task body idle5 is
  1324.         begin 
  1325.             accept init do put_line("idle5"); end init;
  1326.             accept never do null; end never;
  1327.         end idle5;
  1328.  
  1329.     task body idle11 is
  1330.         begin 
  1331.             accept init do put_line("idle11"); end init;
  1332.             accept never do null; end never;
  1333.         end idle11;
  1334.  
  1335.     task body idle12 is
  1336.         begin 
  1337.             accept init do put_line("idle12"); end init;
  1338.             accept never do null; end never;
  1339.         end idle12;
  1340.  
  1341.     task body idle13 is
  1342.         begin 
  1343.             accept init do put_line("idle13"); end init;
  1344.             accept never do null; end never;
  1345.         end idle13;
  1346.  
  1347.     task body idle14 is
  1348.         begin 
  1349.             accept init do put_line("idle14"); end init;
  1350.             accept never do null; end never;
  1351.         end idle14;
  1352.  
  1353.     task body idle15 is
  1354.         begin 
  1355.             accept init do put_line("idle15"); end init;
  1356.             accept never do null; end never;
  1357.         end idle15;
  1358.  
  1359. begin
  1360.     null;
  1361. end test;
  1362.  
  1363.  
  1364. **********************************************************************
  1365. *                            NEXT PROGRAM                            *
  1366. **********************************************************************
  1367.  
  1368.  
  1369. ***** IDLE20 *****
  1370.  
  1371. -- ada tasking tester
  1372. -- task head is the controller
  1373. -- tasks link are the chain of tasks
  1374. -- tasks idle are the standby tasks
  1375.  
  1376. with text_io; use text_io;
  1377.  
  1378. procedure test is
  1379.     cycles: integer;
  1380.     printon: boolean;
  1381.     answer: character;
  1382.  
  1383.     task head is
  1384.         entry give;
  1385.     end head;
  1386.  
  1387.     task link1 is
  1388.         entry give;
  1389.     end link1;
  1390.  
  1391.     task idle1 is
  1392.         entry init;
  1393.         entry never;
  1394.     end idle1;
  1395.  
  1396.     task idle2 is
  1397.         entry init;
  1398.         entry never;
  1399.     end idle2;
  1400.  
  1401.     task idle3 is
  1402.         entry init;
  1403.         entry never;
  1404.     end idle3;
  1405.  
  1406.     task idle4 is
  1407.         entry init;
  1408.         entry never;
  1409.     end idle4;
  1410.  
  1411.     task idle5 is
  1412.         entry init;
  1413.         entry never;
  1414.     end idle5;
  1415.  
  1416.     task idle11 is
  1417.         entry init;
  1418.         entry never;
  1419.     end idle11;
  1420.  
  1421.     task idle12 is
  1422.         entry init;
  1423.         entry never;
  1424.     end idle12;
  1425.  
  1426.     task idle13 is
  1427.         entry init;
  1428.         entry never;
  1429.     end idle13;
  1430.  
  1431.     task idle14 is
  1432.         entry init;
  1433.         entry never;
  1434.     end idle14;
  1435.  
  1436.     task idle15 is
  1437.         entry init;
  1438.         entry never;
  1439.     end idle15;
  1440.  
  1441.     task idle21 is
  1442.         entry init;
  1443.         entry never;
  1444.     end idle21;
  1445.  
  1446.     task idle22 is
  1447.         entry init;
  1448.         entry never;
  1449.     end idle22;
  1450.  
  1451.     task idle23 is
  1452.         entry init;
  1453.         entry never;
  1454.     end idle23;
  1455.  
  1456.     task idle24 is
  1457.         entry init;
  1458.         entry never;
  1459.     end idle24;
  1460.  
  1461.     task idle25 is
  1462.         entry init;
  1463.         entry never;
  1464.     end idle25;
  1465.  
  1466.     task idle211 is
  1467.         entry init;
  1468.         entry never;
  1469.     end idle211;
  1470.  
  1471.     task idle212 is
  1472.         entry init;
  1473.         entry never;
  1474.     end idle212;
  1475.  
  1476.     task idle213 is
  1477.         entry init;
  1478.         entry never;
  1479.     end idle213;
  1480.  
  1481.     task idle214 is
  1482.         entry init;
  1483.         entry never;
  1484.     end idle214;
  1485.  
  1486.     task idle215 is
  1487.         entry init;
  1488.         entry never;
  1489.     end idle215;
  1490.  
  1491.     task body head is
  1492.         begin
  1493.             idle1.init;
  1494.             idle2.init;
  1495.             idle3.init;
  1496.             idle4.init;
  1497.             idle5.init;
  1498.             idle11.init;
  1499.             idle12.init;
  1500.             idle13.init;
  1501.             idle14.init;
  1502.             idle15.init;
  1503.             idle21.init;
  1504.             idle22.init;
  1505.             idle23.init;
  1506.             idle24.init;
  1507.             idle25.init;
  1508.             idle211.init;
  1509.             idle212.init;
  1510.             idle213.init;
  1511.             idle214.init;
  1512.             idle215.init;
  1513.  
  1514.             put("do you want printing (y/n)? ");
  1515.             get(answer);
  1516.     put("answer is "); put(answer); put_line(" ");
  1517.             if answer='y' then
  1518.                 printon := true;
  1519.             else
  1520.                 printon := false;
  1521.             end if;
  1522.     if printon then put_line("printing on"); else put_line("print off");
  1523.     end if;
  1524.             put("how many cycles? ");
  1525. -- doesn't work            get_line(cycles);
  1526.             cycles := 10000;
  1527.  
  1528.             put_line("started");
  1529.             for i in 1..cycles loop
  1530.                 if printon then put_line("head"); end if;
  1531.                 link1.give;
  1532.                 accept give do 
  1533.                     null;
  1534.                 end give;
  1535.             end loop;
  1536.             put_line("ended");
  1537.         end head;
  1538.  
  1539.     task body link1 is
  1540.         begin
  1541.             loop
  1542.                 accept give do 
  1543.                         null;
  1544.                 end give;
  1545.                 if printon then put_line("link1"); end if;
  1546.                 head.give;
  1547.             end loop;
  1548.         end link1;
  1549.  
  1550.     task body idle1 is
  1551.         begin 
  1552.             accept init do put_line("idle1"); end init;
  1553.             accept never do null; end never;
  1554.         end idle1;
  1555.  
  1556.     task body idle2 is
  1557.         begin 
  1558.             accept init do put_line("idle2"); end init;
  1559.             accept never do null; end never;
  1560.         end idle2;
  1561.  
  1562.     task body idle3 is
  1563.         begin 
  1564.             accept init do put_line("idle3"); end init;
  1565.             accept never do null; end never;
  1566.         end idle3;
  1567.  
  1568.     task body idle4 is
  1569.         begin 
  1570.             accept init do put_line("idle4"); end init;
  1571.             accept never do null; end never;
  1572.         end idle4;
  1573.  
  1574.     task body idle5 is
  1575.         begin 
  1576.             accept init do put_line("idle5"); end init;
  1577.             accept never do null; end never;
  1578.         end idle5;
  1579.  
  1580.     task body idle11 is
  1581.         begin 
  1582.             accept init do put_line("idle11"); end init;
  1583.             accept never do null; end never;
  1584.         end idle11;
  1585.  
  1586.     task body idle12 is
  1587.         begin 
  1588.             accept init do put_line("idle12"); end init;
  1589.             accept never do null; end never;
  1590.         end idle12;
  1591.  
  1592.     task body idle13 is
  1593.         begin 
  1594.             accept init do put_line("idle13"); end init;
  1595.             accept never do null; end never;
  1596.         end idle13;
  1597.  
  1598.     task body idle14 is
  1599.         begin 
  1600.             accept init do put_line("idle14"); end init;
  1601.             accept never do null; end never;
  1602.         end idle14;
  1603.  
  1604.     task body idle15 is
  1605.         begin 
  1606.             accept init do put_line("idle15"); end init;
  1607.             accept never do null; end never;
  1608.         end idle15;
  1609.  
  1610.     task body idle21 is
  1611.         begin 
  1612.             accept init do put_line("idle21"); end init;
  1613.             accept never do null; end never;
  1614.         end idle21;
  1615.  
  1616.     task body idle22 is
  1617.         begin 
  1618.             accept init do put_line("idle22"); end init;
  1619.             accept never do null; end never;
  1620.         end idle22;
  1621.  
  1622.     task body idle23 is
  1623.         begin 
  1624.             accept init do put_line("idle23"); end init;
  1625.             accept never do null; end never;
  1626.         end idle23;
  1627.  
  1628.     task body idle24 is
  1629.         begin 
  1630.             accept init do put_line("idle24"); end init;
  1631.             accept never do null; end never;
  1632.         end idle24;
  1633.  
  1634.     task body idle25 is
  1635.         begin 
  1636.             accept init do put_line("idle25"); end init;
  1637.             accept never do null; end never;
  1638.         end idle25;
  1639.  
  1640.     task body idle211 is
  1641.         begin 
  1642.             accept init do put_line("idle211"); end init;
  1643.             accept never do null; end never;
  1644.         end idle211;
  1645.  
  1646.     task body idle212 is
  1647.         begin 
  1648.             accept init do put_line("idle212"); end init;
  1649.             accept never do null; end never;
  1650.         end idle212;
  1651.  
  1652.     task body idle213 is
  1653.         begin 
  1654.             accept init do put_line("idle213"); end init;
  1655.             accept never do null; end never;
  1656.         end idle213;
  1657.  
  1658.     task body idle214 is
  1659.         begin 
  1660.             accept init do put_line("idle214"); end init;
  1661.             accept never do null; end never;
  1662.         end idle214;
  1663.  
  1664.     task body idle215 is
  1665.         begin 
  1666.             accept init do put_line("idle215"); end init;
  1667.             accept never do null; end never;
  1668.         end idle215;
  1669.  
  1670.  
  1671. begin
  1672.     null;
  1673. end test;
  1674.  
  1675.  
  1676. **********************************************************************
  1677. *                            NEXT PROGRAM                            *
  1678. **********************************************************************
  1679.  
  1680.  
  1681. ***** SELECT2 *****
  1682.  
  1683. -- ada tasking tester
  1684. -- task head is the controller
  1685. -- tasks link are the chain of tasks
  1686. -- tasks idle are the standby tasks
  1687.  
  1688. with text_io; use text_io;
  1689.  
  1690. procedure test is
  1691.     cycles: integer;
  1692.     printon: boolean;
  1693.     answer: character;
  1694.  
  1695.     task head is
  1696.         entry give;
  1697.     end head;
  1698.  
  1699.     task link1 is
  1700.         entry give;
  1701.         entry s2;
  1702.     end link1;
  1703.  
  1704.     task body head is
  1705.         begin
  1706.             put("do you want printing (y/n)? ");
  1707.             get(answer);
  1708.     put("answer is "); put(answer); put_line(" ");
  1709.             if answer='y' then
  1710.                 printon := true;
  1711.             else
  1712.                 printon := false;
  1713.             end if;
  1714.     if printon then put_line("printing on"); else put_line("print off");
  1715.     end if;
  1716.             put("how many cycles? ");
  1717. -- doesn't work            get_line(cycles);
  1718.             cycles := 1000;
  1719.  
  1720.             put_line("started");
  1721.             for i in 1..cycles loop
  1722.                 if printon then put_line("head"); end if;
  1723.                 link1.give;
  1724.                 accept give do 
  1725.                     null;
  1726.                 end give;
  1727.             end loop;
  1728.             put_line("ended");
  1729.         end head;
  1730.  
  1731.     task body link1 is
  1732.         begin
  1733.             loop
  1734.                 select
  1735.                 accept give do 
  1736.                         null;
  1737.                 end give;
  1738.                  or    accept s2 do null; end s2;
  1739.                 end select;
  1740.                 if printon then put_line("link1"); end if;
  1741.                 head.give;
  1742.             end loop;
  1743.         end link1;
  1744.  
  1745.  
  1746. begin
  1747.     null;
  1748. end test;
  1749.  
  1750.  
  1751. **********************************************************************
  1752. *                            NEXT PROGRAM                            *
  1753. **********************************************************************
  1754.  
  1755.  
  1756. ***** SELECT2E *****
  1757.  
  1758. -- ada tasking tester
  1759. -- task head is the controller
  1760. -- tasks link are the chain of tasks
  1761. -- tasks idle are the standby tasks
  1762.  
  1763. with text_io; use text_io;
  1764.  
  1765. procedure test is
  1766.     cycles: integer;
  1767.     printon: boolean;
  1768.     answer: character;
  1769.  
  1770.     task head is
  1771.         entry give;
  1772.     end head;
  1773.  
  1774.     task link1 is
  1775.         entry give;
  1776.         entry s2;
  1777.     end link1;
  1778.  
  1779.     task body head is
  1780.         begin
  1781.             put("do you want printing (y/n)? ");
  1782.             get(answer);
  1783.     put("answer is "); put(answer); put_line(" ");
  1784.             if answer='y' then
  1785.                 printon := true;
  1786.             else
  1787.                 printon := false;
  1788.             end if;
  1789.     if printon then put_line("printing on"); else put_line("print off");
  1790.     end if;
  1791.             put("how many cycles? ");
  1792. -- doesn't work            get_line(cycles);
  1793.             cycles := 1000;
  1794.  
  1795.             put_line("started");
  1796.             for i in 1..cycles loop
  1797.                 if printon then put_line("head"); end if;
  1798.                 link1.give;
  1799.                 accept give do 
  1800.                     null;
  1801.                 end give;
  1802.             end loop;
  1803.             put_line("ended");
  1804.         end head;
  1805.  
  1806.     task body link1 is
  1807.         begin
  1808.             loop
  1809.                 select
  1810.                      accept s2 do null; end s2;
  1811.                  or    accept give do 
  1812.                         null;
  1813.                 end give;
  1814.                 end select;
  1815.                 if printon then put_line("link1"); end if;
  1816.                 head.give;
  1817.             end loop;
  1818.         end link1;
  1819.  
  1820.  
  1821. begin
  1822.     null;
  1823. end test;
  1824.  
  1825.  
  1826. **********************************************************************
  1827. *                            NEXT PROGRAM                            *
  1828. **********************************************************************
  1829.  
  1830.  
  1831. ***** SELECT20 *****
  1832.  
  1833. -- ada tasking tester
  1834. -- task head is the controller
  1835. -- tasks link are the chain of tasks
  1836. -- tasks idle are the standby tasks
  1837.  
  1838. with text_io; use text_io;
  1839.  
  1840. procedure test is
  1841.     cycles: integer;
  1842.     printon: boolean;
  1843.     answer: character;
  1844.  
  1845.     task head is
  1846.         entry give;
  1847.     end head;
  1848.  
  1849.     task link1 is
  1850.         entry give;
  1851.         entry s2;
  1852.         entry s3;
  1853.         entry s4;
  1854.         entry s5;
  1855.         entry s6;
  1856.         entry s7;
  1857.         entry s8;
  1858.         entry s9;
  1859.         entry s10;
  1860.         entry s11;
  1861.         entry s12;
  1862.         entry s13;
  1863.         entry s14;
  1864.         entry s15;
  1865.         entry s16;
  1866.         entry s17;
  1867.         entry s18;
  1868.         entry s19;
  1869.         entry s20;
  1870.     end link1;
  1871.  
  1872.     task body head is
  1873.         begin
  1874.             put("do you want printing (y/n)? ");
  1875.             get(answer);
  1876.     put("answer is "); put(answer); put_line(" ");
  1877.             if answer='y' then
  1878.                 printon := true;
  1879.             else
  1880.                 printon := false;
  1881.             end if;
  1882.     if printon then put_line("printing on"); else put_line("print off");
  1883.     end if;
  1884.             put("how many cycles? ");
  1885. -- doesn't work            get_line(cycles);
  1886.             cycles := 1000;
  1887.  
  1888.             put_line("started");
  1889.             for i in 1..cycles loop
  1890.                 if printon then put_line("head"); end if;
  1891.                 link1.give;
  1892.                 accept give do 
  1893.                     null;
  1894.                 end give;
  1895.             end loop;
  1896.             put_line("ended");
  1897.         end head;
  1898.  
  1899.     task body link1 is
  1900.         begin
  1901.             loop
  1902.                 select
  1903.                 accept give do 
  1904.                         null;
  1905.                 end give;
  1906.                  or    accept s2 do null; end s2;
  1907.                  or    accept s3 do null; end s3;
  1908.                  or    accept s4 do null; end s4;
  1909.                  or    accept s5 do null; end s5;
  1910.                  or    accept s6 do null; end s6;
  1911.                  or    accept s7 do null; end s7;
  1912.                  or    accept s8 do null; end s8;
  1913.                  or    accept s9 do null; end s9;
  1914.                  or    accept s10 do null; end s10;
  1915.                  or    accept s11 do null; end s11;
  1916.                  or    accept s12 do null; end s12;
  1917.                  or    accept s13 do null; end s13;
  1918.                  or    accept s14 do null; end s14;
  1919.                  or    accept s15 do null; end s15;
  1920.                  or    accept s16 do null; end s16;
  1921.                  or    accept s17 do null; end s17;
  1922.                  or    accept s18 do null; end s18;
  1923.                  or    accept s19 do null; end s19;
  1924.                  or    accept s20 do null; end s20;
  1925.                 end select;
  1926.                 if printon then put_line("link1"); end if;
  1927.                 head.give;
  1928.             end loop;
  1929.         end link1;
  1930.  
  1931.  
  1932. begin
  1933.     null;
  1934. end test;
  1935.  
  1936.  
  1937. **********************************************************************
  1938. *                            NEXT PROGRAM                            *
  1939. **********************************************************************
  1940.  
  1941.  
  1942. ***** SELECT20E *****
  1943.  
  1944. -- ada tasking tester
  1945. -- task head is the controller
  1946. -- tasks link are the chain of tasks
  1947. -- tasks idle are the standby tasks
  1948.  
  1949. with text_io; use text_io;
  1950.  
  1951. procedure test is
  1952.     cycles: integer;
  1953.     printon: boolean;
  1954.     answer: character;
  1955.  
  1956.     task head is
  1957.         entry give;
  1958.     end head;
  1959.  
  1960.     task link1 is
  1961.         entry give;
  1962.         entry s2;
  1963.         entry s3;
  1964.         entry s4;
  1965.         entry s5;
  1966.         entry s6;
  1967.         entry s7;
  1968.         entry s8;
  1969.         entry s9;
  1970.         entry s10;
  1971.         entry s11;
  1972.         entry s12;
  1973.         entry s13;
  1974.         entry s14;
  1975.         entry s15;
  1976.         entry s16;
  1977.         entry s17;
  1978.         entry s18;
  1979.         entry s19;
  1980.         entry s20;
  1981.     end link1;
  1982.  
  1983.     task body head is
  1984.         begin
  1985.             put("do you want printing (y/n)? ");
  1986.             get(answer);
  1987.     put("answer is "); put(answer); put_line(" ");
  1988.             if answer='y' then
  1989.                 printon := true;
  1990.             else
  1991.                 printon := false;
  1992.             end if;
  1993.     if printon then put_line("printing on"); else put_line("print off");
  1994.     end if;
  1995.             put("how many cycles? ");
  1996. -- doesn't work            get_line(cycles);
  1997.             cycles := 1000;
  1998.  
  1999.             put_line("started");
  2000.             for i in 1..cycles loop
  2001.                 if printon then put_line("head"); end if;
  2002.                 link1.give;
  2003.                 accept give do 
  2004.                     null;
  2005.                 end give;
  2006.             end loop;
  2007.             put_line("ended");
  2008.         end head;
  2009.  
  2010.     task body link1 is
  2011.         begin
  2012.             loop
  2013.                 select
  2014.                      accept s2 do null; end s2;
  2015.                  or    accept s3 do null; end s3;
  2016.                  or    accept s4 do null; end s4;
  2017.                  or    accept s5 do null; end s5;
  2018.                  or    accept s6 do null; end s6;
  2019.                  or    accept s7 do null; end s7;
  2020.                  or    accept s8 do null; end s8;
  2021.                  or    accept s9 do null; end s9;
  2022.                  or    accept s10 do null; end s10;
  2023.                  or    accept s11 do null; end s11;
  2024.                  or    accept s12 do null; end s12;
  2025.                  or    accept s13 do null; end s13;
  2026.                  or    accept s14 do null; end s14;
  2027.                  or    accept s15 do null; end s15;
  2028.                  or    accept s16 do null; end s16;
  2029.                  or    accept s17 do null; end s17;
  2030.                  or    accept s18 do null; end s18;
  2031.                  or    accept s19 do null; end s19;
  2032.                  or    accept s20 do null; end s20;
  2033.                  or    accept give do 
  2034.                         null;
  2035.                 end give;
  2036.                 end select;
  2037.                 if printon then put_line("link1"); end if;
  2038.                 head.give;
  2039.             end loop;
  2040.         end link1;
  2041.  
  2042.  
  2043. begin
  2044.     null;
  2045. end test;
  2046.  
  2047.  
  2048. **********************************************************************
  2049. *                            NEXT PROGRAM                            *
  2050. **********************************************************************
  2051.  
  2052.  
  2053. ***** GUARD2 *****
  2054.  
  2055. -- ada tasking tester
  2056. -- task head is the controller
  2057. -- tasks link are the chain of tasks
  2058. -- tasks idle are the standby tasks
  2059.  
  2060. with text_io; use text_io;
  2061.  
  2062. procedure test is
  2063.     cycles: integer;
  2064.     printon: boolean;
  2065.     answer: character;
  2066.     g1: boolean := true;
  2067.     g2: boolean := false;
  2068.  
  2069.     task head is
  2070.         entry give;
  2071.     end head;
  2072.  
  2073.     task link1 is
  2074.         entry give;
  2075.         entry s2;
  2076.     end link1;
  2077.  
  2078.     task body head is
  2079.         begin
  2080.             put("do you want printing (y/n)? ");
  2081.             get(answer);
  2082.     put("answer is "); put(answer); put_line(" ");
  2083.             if answer='y' then
  2084.                 printon := true;
  2085.             else
  2086.                 printon := false;
  2087.             end if;
  2088.     if printon then put_line("printing on"); else put_line("print off");
  2089.     end if;
  2090.             put("how many cycles? ");
  2091. -- doesn't work            get_line(cycles);
  2092.             cycles := 1000;
  2093.  
  2094.             put_line("started");
  2095.             for i in 1..cycles loop
  2096.                 if printon then put_line("head"); end if;
  2097.                 link1.give;
  2098.                 accept give do 
  2099.                     null;
  2100.                 end give;
  2101.             end loop;
  2102.             put_line("ended");
  2103.         end head;
  2104.  
  2105.     task body link1 is
  2106.         begin
  2107.             loop
  2108.                 select
  2109.                 when g1  => accept give do null; end give; 
  2110.                  or    when g2  => accept s2 do null; end s2;
  2111.                 end select;
  2112.                 if printon then put_line("link1"); end if;
  2113.                 head.give;
  2114.             end loop;
  2115.         end link1;
  2116.  
  2117.  
  2118. begin
  2119.     null;
  2120. end test;
  2121.  
  2122.  
  2123. **********************************************************************
  2124. *                            NEXT PROGRAM                            *
  2125. **********************************************************************
  2126.  
  2127.  
  2128. ***** GUARD2E *****
  2129.  
  2130. -- ada tasking tester
  2131. -- task head is the controller
  2132. -- tasks link are the chain of tasks
  2133. -- tasks idle are the standby tasks
  2134.  
  2135. with text_io; use text_io;
  2136.  
  2137. procedure test is
  2138.     cycles: integer;
  2139.     printon: boolean;
  2140.     answer: character;
  2141.     g1: boolean := true;
  2142.     g2: boolean := false;
  2143.  
  2144.     task head is
  2145.         entry give;
  2146.     end head;
  2147.  
  2148.     task link1 is
  2149.         entry give;
  2150.         entry s2;
  2151.     end link1;
  2152.  
  2153.     task body head is
  2154.         begin
  2155.             put("do you want printing (y/n)? ");
  2156.             get(answer);
  2157.     put("answer is "); put(answer); put_line(" ");
  2158.             if answer='y' then
  2159.                 printon := true;
  2160.             else
  2161.                 printon := false;
  2162.             end if;
  2163.     if printon then put_line("printing on"); else put_line("print off");
  2164.     end if;
  2165.             put("how many cycles? ");
  2166. -- doesn't work            get_line(cycles);
  2167.             cycles := 1000;
  2168.  
  2169.             put_line("started");
  2170.             for i in 1..cycles loop
  2171.                 if printon then put_line("head"); end if;
  2172.                 link1.give;
  2173.                 accept give do 
  2174.                     null;
  2175.                 end give;
  2176.             end loop;
  2177.             put_line("ended");
  2178.         end head;
  2179.  
  2180.     task body link1 is
  2181.         begin
  2182.             loop
  2183.                 select
  2184.                      when g2  => accept s2 do null; end s2;
  2185.                  or    when g1  => accept give do null; end give; 
  2186.                 end select;
  2187.                 if printon then put_line("link1"); end if;
  2188.                 head.give;
  2189.             end loop;
  2190.         end link1;
  2191.  
  2192.  
  2193. begin
  2194.     null;
  2195. end test;
  2196.  
  2197.  
  2198. **********************************************************************
  2199. *                            NEXT PROGRAM                            *
  2200. **********************************************************************
  2201.  
  2202.  
  2203. ***** GUARD20 *****
  2204.  
  2205. -- ada tasking tester
  2206. -- task head is the controller
  2207. -- tasks link are the chain of tasks
  2208. -- tasks idle are the standby tasks
  2209.  
  2210. with text_io; use text_io;
  2211.  
  2212. procedure test is
  2213.     cycles: integer;
  2214.     printon: boolean;
  2215.     answer: character;
  2216.     g1: boolean := true;
  2217.     g2: boolean := false;
  2218.     g3: boolean := false;
  2219.     g4: boolean := false;
  2220.     g5: boolean := false;
  2221.     g6: boolean := false;
  2222.     g7: boolean := false;
  2223.     g8: boolean := false;
  2224.     g9: boolean := false;
  2225.     g10: boolean := false;
  2226.     g11: boolean := false;
  2227.     g12: boolean := false;
  2228.     g13: boolean := false;
  2229.     g14: boolean := false;
  2230.     g15: boolean := false;
  2231.     g16: boolean := false;
  2232.     g17: boolean := false;
  2233.     g18: boolean := false;
  2234.     g19: boolean := false;
  2235.     g20: boolean := false;
  2236.  
  2237.     task head is
  2238.         entry give;
  2239.     end head;
  2240.  
  2241.     task link1 is
  2242.         entry give;
  2243.         entry s2;
  2244.         entry s3;
  2245.         entry s4;
  2246.         entry s5;
  2247.         entry s6;
  2248.         entry s7;
  2249.         entry s8;
  2250.         entry s9;
  2251.         entry s10;
  2252.         entry s11;
  2253.         entry s12;
  2254.         entry s13;
  2255.         entry s14;
  2256.         entry s15;
  2257.         entry s16;
  2258.         entry s17;
  2259.         entry s18;
  2260.         entry s19;
  2261.         entry s20;
  2262.     end link1;
  2263.  
  2264.     task body head is
  2265.         begin
  2266.             put("do you want printing (y/n)? ");
  2267.             get(answer);
  2268.     put("answer is "); put(answer); put_line(" ");
  2269.             if answer='y' then
  2270.                 printon := true;
  2271.             else
  2272.                 printon := false;
  2273.             end if;
  2274.     if printon then put_line("printing on"); else put_line("print off");
  2275.     end if;
  2276.             put("how many cycles? ");
  2277. -- doesn't work            get_line(cycles);
  2278.             cycles := 1000;
  2279.  
  2280.             put_line("started");
  2281.             for i in 1..cycles loop
  2282.                 if printon then put_line("head"); end if;
  2283.                 link1.give;
  2284.                 accept give do 
  2285.                     null;
  2286.                 end give;
  2287.             end loop;
  2288.             put_line("ended");
  2289.         end head;
  2290.  
  2291.     task body link1 is
  2292.         begin
  2293.             loop
  2294.                 select
  2295.                 when g1  => accept give do null; end give; 
  2296.                  or    when g2  => accept s2 do null; end s2;
  2297.                  or    when g3  => accept s3 do null; end s3;
  2298.                  or    when g4  => accept s4 do null; end s4;
  2299.                  or    when g5  => accept s5 do null; end s5;
  2300.                  or    when g6  => accept s6 do null; end s6;
  2301.                  or    when g7  => accept s7 do null; end s7;
  2302.                  or    when g8  => accept s8 do null; end s8;
  2303.                  or    when g9  => accept s9 do null; end s9;
  2304.                  or    when g10  => accept s10 do null; end s10;
  2305.                  or    when g11  => accept s11 do null; end s11;
  2306.                  or    when g12  => accept s12 do null; end s12;
  2307.                  or    when g13  => accept s13 do null; end s13;
  2308.                  or    when g14  => accept s14 do null; end s14;
  2309.                  or    when g15  => accept s15 do null; end s15;
  2310.                  or    when g16  => accept s16 do null; end s16;
  2311.                  or    when g17  => accept s17 do null; end s17;
  2312.                  or    when g18  => accept s18 do null; end s18;
  2313.                  or    when g19  => accept s19 do null; end s19;
  2314.                  or    when g20  => accept s20 do null; end s20;
  2315.                 end select;
  2316.                 if printon then put_line("link1"); end if;
  2317.                 head.give;
  2318.             end loop;
  2319.         end link1;
  2320.  
  2321.  
  2322. begin
  2323.     null;
  2324. end test;
  2325.  
  2326.  
  2327. **********************************************************************
  2328. *                            NEXT PROGRAM                            *
  2329. **********************************************************************
  2330.  
  2331.  
  2332. ***** GUARD20E *****
  2333.  
  2334. -- ada tasking tester
  2335. -- task head is the controller
  2336. -- tasks link are the chain of tasks
  2337. -- tasks idle are the standby tasks
  2338.  
  2339. with text_io; use text_io;
  2340.  
  2341. procedure test is
  2342.     cycles: integer;
  2343.     printon: boolean;
  2344.     answer: character;
  2345.     g1: boolean := true;
  2346.     g2: boolean := false;
  2347.     g3: boolean := false;
  2348.     g4: boolean := false;
  2349.     g5: boolean := false;
  2350.     g6: boolean := false;
  2351.     g7: boolean := false;
  2352.     g8: boolean := false;
  2353.     g9: boolean := false;
  2354.     g10: boolean := false;
  2355.     g11: boolean := false;
  2356.     g12: boolean := false;
  2357.     g13: boolean := false;
  2358.     g14: boolean := false;
  2359.     g15: boolean := false;
  2360.     g16: boolean := false;
  2361.     g17: boolean := false;
  2362.     g18: boolean := false;
  2363.     g19: boolean := false;
  2364.     g20: boolean := false;
  2365.  
  2366.     task head is
  2367.         entry give;
  2368.     end head;
  2369.  
  2370.     task link1 is
  2371.         entry give;
  2372.         entry s2;
  2373.         entry s3;
  2374.         entry s4;
  2375.         entry s5;
  2376.         entry s6;
  2377.         entry s7;
  2378.         entry s8;
  2379.         entry s9;
  2380.         entry s10;
  2381.         entry s11;
  2382.         entry s12;
  2383.         entry s13;
  2384.         entry s14;
  2385.         entry s15;
  2386.         entry s16;
  2387.         entry s17;
  2388.         entry s18;
  2389.         entry s19;
  2390.         entry s20;
  2391.     end link1;
  2392.  
  2393.     task body head is
  2394.         begin
  2395.             put("do you want printing (y/n)? ");
  2396.             get(answer);
  2397.     put("answer is "); put(answer); put_line(" ");
  2398.             if answer='y' then
  2399.                 printon := true;
  2400.             else
  2401.                 printon := false;
  2402.             end if;
  2403.     if printon then put_line("printing on"); else put_line("print off");
  2404.     end if;
  2405.             put("how many cycles? ");
  2406. -- doesn't work            get_line(cycles);
  2407.             cycles := 1000;
  2408.  
  2409.             put_line("started");
  2410.             for i in 1..cycles loop
  2411.                 if printon then put_line("head"); end if;
  2412.                 link1.give;
  2413.                 accept give do 
  2414.                     null;
  2415.                 end give;
  2416.             end loop;
  2417.             put_line("ended");
  2418.         end head;
  2419.  
  2420.     task body link1 is
  2421.         begin
  2422.             loop
  2423.                 select
  2424.                      when g2  => accept s2 do null; end s2;
  2425.                  or    when g3  => accept s3 do null; end s3;
  2426.                  or    when g4  => accept s4 do null; end s4;
  2427.                  or    when g5  => accept s5 do null; end s5;
  2428.                  or    when g6  => accept s6 do null; end s6;
  2429.                  or    when g7  => accept s7 do null; end s7;
  2430.                  or    when g8  => accept s8 do null; end s8;
  2431.                  or    when g9  => accept s9 do null; end s9;
  2432.                  or    when g10  => accept s10 do null; end s10;
  2433.                  or    when g11  => accept s11 do null; end s11;
  2434.                  or    when g12  => accept s12 do null; end s12;
  2435.                  or    when g13  => accept s13 do null; end s13;
  2436.                  or    when g14  => accept s14 do null; end s14;
  2437.                  or    when g15  => accept s15 do null; end s15;
  2438.                  or    when g16  => accept s16 do null; end s16;
  2439.                  or    when g17  => accept s17 do null; end s17;
  2440.                  or    when g18  => accept s18 do null; end s18;
  2441.                  or    when g19  => accept s19 do null; end s19;
  2442.                  or    when g20  => accept s20 do null; end s20;
  2443.                  or    when g1  => accept give do null; end give; 
  2444.                 end select;
  2445.                 if printon then put_line("link1"); end if;
  2446.                 head.give;
  2447.             end loop;
  2448.         end link1;
  2449.  
  2450.  
  2451. begin
  2452.     null;
  2453. end test;
  2454.  
  2455.  
  2456. **********************************************************************
  2457. *                            NEXT PROGRAM                            *
  2458. **********************************************************************
  2459.  
  2460.  
  2461. ***** GUARD20T *****
  2462.  
  2463. -- ada tasking tester
  2464. -- task head is the controller
  2465. -- tasks link are the chain of tasks
  2466. -- tasks idle are the standby tasks
  2467.  
  2468. with text_io; use text_io;
  2469.  
  2470. procedure test is
  2471.     cycles: integer;
  2472.     printon: boolean;
  2473.     answer: character;
  2474.     g1: boolean := true;
  2475.     g2: boolean := true;
  2476.     g3: boolean := true;
  2477.     g4: boolean := true;
  2478.     g5: boolean := true;
  2479.     g6: boolean := true;
  2480.     g7: boolean := true;
  2481.     g8: boolean := true;
  2482.     g9: boolean := true;
  2483.     g10: boolean := true;
  2484.     g11: boolean := true;
  2485.     g12: boolean := true;
  2486.     g13: boolean := true;
  2487.     g14: boolean := true;
  2488.     g15: boolean := true;
  2489.     g16: boolean := true;
  2490.     g17: boolean := true;
  2491.     g18: boolean := true;
  2492.     g19: boolean := true;
  2493.     g20: boolean := true;
  2494.  
  2495.     task head is
  2496.         entry give;
  2497.     end head;
  2498.  
  2499.     task link1 is
  2500.         entry give;
  2501.         entry s2;
  2502.         entry s3;
  2503.         entry s4;
  2504.         entry s5;
  2505.         entry s6;
  2506.         entry s7;
  2507.         entry s8;
  2508.         entry s9;
  2509.         entry s10;
  2510.         entry s11;
  2511.         entry s12;
  2512.         entry s13;
  2513.         entry s14;
  2514.         entry s15;
  2515.         entry s16;
  2516.         entry s17;
  2517.         entry s18;
  2518.         entry s19;
  2519.         entry s20;
  2520.     end link1;
  2521.  
  2522.     task body head is
  2523.         begin
  2524.             put("do you want printing (y/n)? ");
  2525.             get(answer);
  2526.     put("answer is "); put(answer); put_line(" ");
  2527.             if answer='y' then
  2528.                 printon := true;
  2529.             else
  2530.                 printon := false;
  2531.             end if;
  2532.     if printon then put_line("printing on"); else put_line("print off");
  2533.     end if;
  2534.             put("how many cycles? ");
  2535. -- doesn't work            get_line(cycles);
  2536.             cycles := 1000;
  2537.  
  2538.             put_line("started");
  2539.             for i in 1..cycles loop
  2540.                 if printon then put_line("head"); end if;
  2541.                 link1.give;
  2542.                 accept give do 
  2543.                     null;
  2544.                 end give;
  2545.             end loop;
  2546.             put_line("ended");
  2547.         end head;
  2548.  
  2549.     task body link1 is
  2550.         begin
  2551.             loop
  2552.                 select
  2553.                 when g1  => accept give do null; end give; 
  2554.                  or    when g2  => accept s2 do null; end s2;
  2555.                  or    when g3  => accept s3 do null; end s3;
  2556.                  or    when g4  => accept s4 do null; end s4;
  2557.                  or    when g5  => accept s5 do null; end s5;
  2558.                  or    when g6  => accept s6 do null; end s6;
  2559.                  or    when g7  => accept s7 do null; end s7;
  2560.                  or    when g8  => accept s8 do null; end s8;
  2561.                  or    when g9  => accept s9 do null; end s9;
  2562.                  or    when g10  => accept s10 do null; end s10;
  2563.                  or    when g11  => accept s11 do null; end s11;
  2564.                  or    when g12  => accept s12 do null; end s12;
  2565.                  or    when g13  => accept s13 do null; end s13;
  2566.                  or    when g14  => accept s14 do null; end s14;
  2567.                  or    when g15  => accept s15 do null; end s15;
  2568.                  or    when g16  => accept s16 do null; end s16;
  2569.                  or    when g17  => accept s17 do null; end s17;
  2570.                  or    when g18  => accept s18 do null; end s18;
  2571.                  or    when g19  => accept s19 do null; end s19;
  2572.                  or    when g20  => accept s20 do null; end s20;
  2573.                 end select;
  2574.                 if printon then put_line("link1"); end if;
  2575.                 head.give;
  2576.             end loop;
  2577.         end link1;
  2578.  
  2579.  
  2580. begin
  2581.     null;
  2582. end test;
  2583.  
  2584.  
  2585. **********************************************************************
  2586. *                            NEXT PROGRAM                            *
  2587. **********************************************************************
  2588.  
  2589.  
  2590. ***** GUARD20ET *****
  2591.  
  2592. -- ada tasking tester
  2593. -- task head is the controller
  2594. -- tasks link are the chain of tasks
  2595. -- tasks idle are the standby tasks
  2596.  
  2597. with text_io; use text_io;
  2598.  
  2599. procedure test is
  2600.     cycles: integer;
  2601.     printon: boolean;
  2602.     answer: character;
  2603.     g1: boolean := true;
  2604.     g2: boolean := true;
  2605.     g3: boolean := true;
  2606.     g4: boolean := true;
  2607.     g5: boolean := true;
  2608.     g6: boolean := true;
  2609.     g7: boolean := true;
  2610.     g8: boolean := true;
  2611.     g9: boolean := true;
  2612.     g10: boolean := true;
  2613.     g11: boolean := true;
  2614.     g12: boolean := true;
  2615.     g13: boolean := true;
  2616.     g14: boolean := true;
  2617.     g15: boolean := true;
  2618.     g16: boolean := true;
  2619.     g17: boolean := true;
  2620.     g18: boolean := true;
  2621.     g19: boolean := true;
  2622.     g20: boolean := true;
  2623.  
  2624.     task head is
  2625.         entry give;
  2626.     end head;
  2627.  
  2628.     task link1 is
  2629.         entry give;
  2630.         entry s2;
  2631.         entry s3;
  2632.         entry s4;
  2633.         entry s5;
  2634.         entry s6;
  2635.         entry s7;
  2636.         entry s8;
  2637.         entry s9;
  2638.         entry s10;
  2639.         entry s11;
  2640.         entry s12;
  2641.         entry s13;
  2642.         entry s14;
  2643.         entry s15;
  2644.         entry s16;
  2645.         entry s17;
  2646.         entry s18;
  2647.         entry s19;
  2648.         entry s20;
  2649.     end link1;
  2650.  
  2651.     task body head is
  2652.         begin
  2653.             put("do you want printing (y/n)? ");
  2654.             get(answer);
  2655.     put("answer is "); put(answer); put_line(" ");
  2656.             if answer='y' then
  2657.                 printon := true;
  2658.             else
  2659.                 printon := false;
  2660.             end if;
  2661.     if printon then put_line("printing on"); else put_line("print off");
  2662.     end if;
  2663.             put("how many cycles? ");
  2664. -- doesn't work            get_line(cycles);
  2665.             cycles := 1000;
  2666.  
  2667.             put_line("started");
  2668.             for i in 1..cycles loop
  2669.                 if printon then put_line("head"); end if;
  2670.                 link1.give;
  2671.                 accept give do 
  2672.                     null;
  2673.                 end give;
  2674.             end loop;
  2675.             put_line("ended");
  2676.         end head;
  2677.  
  2678.     task body link1 is
  2679.         begin
  2680.             loop
  2681.                 select
  2682.                      when g2  => accept s2 do null; end s2;
  2683.                  or    when g3  => accept s3 do null; end s3;
  2684.                  or    when g4  => accept s4 do null; end s4;
  2685.                  or    when g5  => accept s5 do null; end s5;
  2686.                  or    when g6  => accept s6 do null; end s6;
  2687.                  or    when g7  => accept s7 do null; end s7;
  2688.                  or    when g8  => accept s8 do null; end s8;
  2689.                  or    when g9  => accept s9 do null; end s9;
  2690.                  or    when g10  => accept s10 do null; end s10;
  2691.                  or    when g11  => accept s11 do null; end s11;
  2692.                  or    when g12  => accept s12 do null; end s12;
  2693.                  or    when g13  => accept s13 do null; end s13;
  2694.                  or    when g14  => accept s14 do null; end s14;
  2695.                  or    when g15  => accept s15 do null; end s15;
  2696.                  or    when g16  => accept s16 do null; end s16;
  2697.                  or    when g17  => accept s17 do null; end s17;
  2698.                  or    when g18  => accept s18 do null; end s18;
  2699.                  or    when g19  => accept s19 do null; end s19;
  2700.                  or    when g20  => accept s20 do null; end s20;
  2701.                  or    when g1  => accept give do null; end give; 
  2702.                 end select;
  2703.                 if printon then put_line("link1"); end if;
  2704.                 head.give;
  2705.             end loop;
  2706.         end link1;
  2707.  
  2708.  
  2709. begin
  2710.     null;
  2711. end test;
  2712.  
  2713.  
  2714. **********************************************************************
  2715. *                            NEXT PROGRAM                            *
  2716. **********************************************************************
  2717.  
  2718.  
  2719. ***** CHAIN2N *****
  2720.  
  2721. -- ada tasking tester
  2722. -- task head is the controller
  2723. -- tasks link are the chain of tasks
  2724. -- tasks idle are the standby tasks
  2725.  
  2726. with text_io; use text_io;
  2727.  
  2728. procedure test is
  2729.     cycles: integer;
  2730.     printon: boolean;
  2731.     answer: character;
  2732.  
  2733.     task head is
  2734.         entry give;
  2735.     end head;
  2736.  
  2737.     task link1 is
  2738.         entry give;
  2739.     end link1;
  2740.  
  2741.     task body head is
  2742.         begin
  2743.             put("do you want printing (y/n)? ");
  2744.             get(answer);
  2745.     put("answer is "); put(answer); put_line(" ");
  2746.             if answer='y' then
  2747.                 printon := true;
  2748.             else
  2749.                 printon := false;
  2750.             end if;
  2751.     if printon then put_line("printing on"); else put_line("print off");
  2752.     end if;
  2753.             put("how many cycles? ");
  2754. -- doesn't work            get_line(cycles);
  2755.             cycles := 10000;
  2756.  
  2757.             put_line("started");
  2758.             for i in 1..cycles loop
  2759.                 if printon then put_line("head"); end if;
  2760.                 link1.give;
  2761.                 accept give do 
  2762.                     null;
  2763.                 end give;
  2764.             end loop;
  2765.             put_line("ended");
  2766.         end head;
  2767.  
  2768.     task body link1 is
  2769.         begin
  2770.             loop
  2771.                 accept give do 
  2772.                         null;
  2773.                 end give;
  2774.                 if printon then put_line("link1"); end if;
  2775.                 head.give;
  2776.             end loop;
  2777.         end link1;
  2778.  
  2779.  
  2780. begin
  2781.     null;
  2782. end test;
  2783.  
  2784.  
  2785. **********************************************************************
  2786. *                            NEXT PROGRAM                            *
  2787. **********************************************************************
  2788.  
  2789.  
  2790. ***** CHAIN2PKT *****
  2791.  
  2792. -- ada tasking tester
  2793. -- task head is the controller
  2794. -- tasks link are the chain of tasks
  2795. -- tasks idle are the standby tasks
  2796.  
  2797. with text_io; use text_io;
  2798.  
  2799. procedure test is
  2800.     cycles: integer;
  2801.     printon: boolean;
  2802.     answer: character;
  2803.  
  2804.     type vector is array(integer range <>) of integer;
  2805.  
  2806.     type pkt_type;
  2807.     type pkt_ptr is access pkt_type;
  2808.     type pkt_type is record
  2809.         next:    pkt_ptr;
  2810.         header:    vector(1..25);
  2811.         data:    string(1..50);
  2812.         tailer:    vector(1..25);
  2813.     end record;
  2814.  
  2815.     task head is
  2816.         entry give(p:in pkt_type);
  2817.     end head;
  2818.  
  2819.     task link1 is
  2820.         entry give(p:in pkt_type);
  2821.     end link1;
  2822.  
  2823.     task body head is
  2824.         pkt : pkt_type;
  2825.         begin
  2826.             put("do you want printing (y/n)? ");
  2827.             get(answer);
  2828.     put("answer is "); put(answer); put_line(" ");
  2829.             if answer='y' then
  2830.                 printon := true;
  2831.             else
  2832.                 printon := false;
  2833.             end if;
  2834.     if printon then put_line("printing on"); else put_line("print off");
  2835.     end if;
  2836.             put("how many cycles? ");
  2837. -- doesn't work            get_line(cycles);
  2838.             cycles := 10000;
  2839.  
  2840.             put_line("started");
  2841.             for i in 1..cycles loop
  2842.                 if printon then put_line("head"); end if;
  2843.                 link1.give(pkt);
  2844.                 accept give(p:in pkt_type) do 
  2845.                     null;
  2846.                 end give;
  2847.             end loop;
  2848.             put_line("ended");
  2849.         end head;
  2850.  
  2851.     task body link1 is
  2852.         pkt: pkt_type;
  2853.         begin
  2854.             loop
  2855.                 accept give(p:in pkt_type) do 
  2856.                         null;
  2857.                 end give;
  2858.                 if printon then put_line("link1"); end if;
  2859.                 head.give(pkt);
  2860.             end loop;
  2861.         end link1;
  2862.  
  2863.  
  2864. begin
  2865.     null;
  2866. end test;
  2867.  
  2868.  
  2869. **********************************************************************
  2870. *                            NEXT PROGRAM                            *
  2871. **********************************************************************
  2872.  
  2873.  
  2874. ***** CHAIN2PTR *****
  2875.  
  2876. -- ada tasking tester
  2877. -- task head is the controller
  2878. -- tasks link are the chain of tasks
  2879. -- tasks idle are the standby tasks
  2880.  
  2881. with text_io; use text_io;
  2882.  
  2883. procedure test is
  2884.     cycles: integer;
  2885.     printon: boolean;
  2886.     answer: character;
  2887.  
  2888.     type vector is array(integer range <>) of integer;
  2889.  
  2890.     type pkt_type;
  2891.     type pkt_ptr is access pkt_type;
  2892.     type pkt_type is record
  2893.         next:    pkt_ptr;
  2894.         header:    vector(1..25);
  2895.         data:    string(1..50);
  2896.         tailer:    vector(1..25);
  2897.     end record;
  2898.  
  2899.     task head is
  2900.         entry give(p:in pkt_ptr);
  2901.     end head;
  2902.  
  2903.     task link1 is
  2904.         entry give(p:in pkt_ptr);
  2905.     end link1;
  2906.  
  2907.     task body head is
  2908.         pkt : pkt_ptr;
  2909.         begin
  2910.             pkt := new pkt_type;
  2911.             put("do you want printing (y/n)? ");
  2912.             get(answer);
  2913.     put("answer is "); put(answer); put_line(" ");
  2914.             if answer='y' then
  2915.                 printon := true;
  2916.             else
  2917.                 printon := false;
  2918.             end if;
  2919.     if printon then put_line("printing on"); else put_line("print off");
  2920.     end if;
  2921.             put("how many cycles? ");
  2922. -- doesn't work            get_line(cycles);
  2923.             cycles := 10000;
  2924.  
  2925.             put_line("started");
  2926.             for i in 1..cycles loop
  2927.                 if printon then put_line("head"); end if;
  2928.                 link1.give(pkt);
  2929.                 accept give(p:in pkt_ptr) do 
  2930.                     null;
  2931.                 end give;
  2932.             end loop;
  2933.             put_line("ended");
  2934.         end head;
  2935.  
  2936.     task body link1 is
  2937.         pkt: pkt_ptr;
  2938.         begin
  2939.             pkt := new pkt_type;
  2940.             loop
  2941.                 accept give(p:in pkt_ptr) do 
  2942.                         null;
  2943.                 end give;
  2944.                 if printon then put_line("link1"); end if;
  2945.                 head.give(pkt);
  2946.             end loop;
  2947.         end link1;
  2948.  
  2949.  
  2950. begin
  2951.     null;
  2952. end test;
  2953.  
  2954.  
  2955. **********************************************************************
  2956. *                            NEXT PROGRAM                            *
  2957. **********************************************************************
  2958.  
  2959.  
  2960. ***** PASSARRYS *****
  2961.  
  2962. -- ada tasking tester
  2963. -- task head is the controller
  2964. -- tasks link are the chain of tasks
  2965. -- tasks idle are the standby tasks
  2966.  
  2967. with text_io; use text_io;
  2968.  
  2969. procedure test is
  2970.     cycles: integer;
  2971.     printon: boolean;
  2972.     answer: character;
  2973.  
  2974.     type param_type is array(1..2) of character;
  2975.  
  2976.     task head is
  2977.         entry give(p:in param_type);
  2978.     end head;
  2979.  
  2980.     task link1 is
  2981.         entry give(p:in param_type);
  2982.     end link1;
  2983.  
  2984.     task body head is
  2985.         p : param_type;
  2986.         begin
  2987.             put("do you want printing (y/n)? ");
  2988.             get(answer);
  2989.     put("answer is "); put(answer); put_line(" ");
  2990.             if answer='y' then
  2991.                 printon := true;
  2992.             else
  2993.                 printon := false;
  2994.             end if;
  2995.     if printon then put_line("printing on"); else put_line("print off");
  2996.     end if;
  2997.             put("how many cycles? ");
  2998. -- doesn't work            get_line(cycles);
  2999.             cycles := 10000;
  3000.  
  3001.             put_line("started");
  3002.             for i in 1..cycles loop
  3003.                 if printon then put_line("head"); end if;
  3004.                 link1.give(p);
  3005.                 accept give(p:in param_type) do 
  3006.                     null;
  3007.                 end give;
  3008.             end loop;
  3009.             put_line("ended");
  3010.         end head;
  3011.  
  3012.     task body link1 is
  3013.         p: param_type;
  3014.         begin
  3015.             loop
  3016.                 accept give(p:in param_type) do 
  3017.                         null;
  3018.                 end give;
  3019.                 if printon then put_line("link1"); end if;
  3020.                 head.give(p);
  3021.             end loop;
  3022.         end link1;
  3023.  
  3024.  
  3025. begin
  3026.     null;
  3027. end test;
  3028.  
  3029.  
  3030. **********************************************************************
  3031. *                            NEXT PROGRAM                            *
  3032. **********************************************************************
  3033.  
  3034.  
  3035. ***** PASSARRYB *****
  3036.  
  3037. -- ada tasking tester
  3038. -- task head is the controller
  3039. -- tasks link are the chain of tasks
  3040. -- tasks idle are the standby tasks
  3041.  
  3042. with text_io; use text_io;
  3043.  
  3044. procedure test is
  3045.     cycles: integer;
  3046.     printon: boolean;
  3047.     answer: character;
  3048.                 -- 32000 is biggest char arry legal
  3049.     type param_type is array(1..32000) of integer;
  3050.  
  3051.     task head is
  3052.         entry give(p:in param_type);
  3053.     end head;
  3054.  
  3055.     task link1 is
  3056.         entry give(p:in param_type);
  3057.     end link1;
  3058.  
  3059.     task body head is
  3060.         p : param_type;
  3061.         begin
  3062.             put("do you want printing (y/n)? ");
  3063.             get(answer);
  3064.     put("answer is "); put(answer); put_line(" ");
  3065.             if answer='y' then
  3066.                 printon := true;
  3067.             else
  3068.                 printon := false;
  3069.             end if;
  3070.     if printon then put_line("printing on"); else put_line("print off");
  3071.     end if;
  3072.             put("how many cycles? ");
  3073. -- doesn't work            get_line(cycles);
  3074.             cycles := 10000;
  3075.  
  3076.             put_line("started");
  3077.             for i in 1..cycles loop
  3078.                 if printon then put_line("head"); end if;
  3079.                 link1.give(p);
  3080.                 accept give(p:in param_type) do 
  3081.                     null;
  3082.                 end give;
  3083.             end loop;
  3084.             put_line("ended");
  3085.         end head;
  3086.  
  3087.     task body link1 is
  3088.         p: param_type;
  3089.         begin
  3090.             loop
  3091.                 accept give(p:in param_type) do 
  3092.                         null;
  3093.                 end give;
  3094.                 if printon then put_line("link1"); end if;
  3095.                 head.give(p);
  3096.             end loop;
  3097.         end link1;
  3098.  
  3099.  
  3100. begin
  3101.     null;
  3102. end test;
  3103.  
  3104.  
  3105. **********************************************************************
  3106. *                            NEXT PROGRAM                            *
  3107. **********************************************************************
  3108.  
  3109.  
  3110. ***** PASSINOUT *****
  3111.  
  3112. -- ada tasking tester
  3113. -- task head is the controller
  3114. -- tasks link are the chain of tasks
  3115. -- tasks idle are the standby tasks
  3116.  
  3117. with text_io; use text_io;
  3118.  
  3119. procedure test is
  3120.     cycles: integer;
  3121.     printon: boolean;
  3122.     answer: character;
  3123.                 -- 32000 is biggest char arry legal
  3124.     type param_type is array(1..32000) of integer;
  3125.  
  3126.     task head is
  3127.         entry give(p:in out param_type);
  3128.     end head;
  3129.  
  3130.     task link1 is
  3131.         entry give(p:in out param_type);
  3132.     end link1;
  3133.  
  3134.     task body head is
  3135.         p : param_type;
  3136.         begin
  3137.             put("do you want printing (y/n)? ");
  3138.             get(answer);
  3139.     put("answer is "); put(answer); put_line(" ");
  3140.             if answer='y' then
  3141.                 printon := true;
  3142.             else
  3143.                 printon := false;
  3144.             end if;
  3145.     if printon then put_line("printing on"); else put_line("print off");
  3146.     end if;
  3147.             put("how many cycles? ");
  3148. -- doesn't work            get_line(cycles);
  3149.             cycles := 10000;
  3150.  
  3151.             put_line("started");
  3152.             for i in 1..cycles loop
  3153.                 if printon then put_line("head"); end if;
  3154.                 link1.give(p);
  3155.                 accept give(p:in out param_type) do 
  3156.                     null;
  3157.                 end give;
  3158.             end loop;
  3159.             put_line("ended");
  3160.         end head;
  3161.  
  3162.     task body link1 is
  3163.         p: param_type;
  3164.         begin
  3165.             loop
  3166.                 accept give(p:in out param_type) do 
  3167.                         null;
  3168.                 end give;
  3169.                 if printon then put_line("link1"); end if;
  3170.                 head.give(p);
  3171.             end loop;
  3172.         end link1;
  3173.  
  3174.  
  3175. begin
  3176.     null;
  3177. end test;
  3178.  
  3179.  
  3180. **********************************************************************
  3181. *                            NEXT PROGRAM                            *
  3182. **********************************************************************
  3183.  
  3184.  
  3185. *I
  3186. ***** MORETASKS *****
  3187.  
  3188. -- ada tasking tester
  3189. -- task head is the controller
  3190. -- tasks link are the chain of tasks
  3191. -- tasks idle are the standby tasks
  3192.  
  3193. with text_io; use text_io;
  3194.  
  3195. procedure test is
  3196.     cycles: integer;
  3197.     printon: boolean;
  3198.     answer: character;
  3199.  
  3200.     task head;
  3201.  
  3202.     task link1 is
  3203.         entry give;
  3204.     end link1;
  3205.     task link2 is
  3206.         entry give;
  3207.     end link2;
  3208.     task link3 is
  3209.         entry give;
  3210.     end link3;
  3211.     task link4 is
  3212.         entry give;
  3213.     end link4;
  3214.     task link5 is
  3215.         entry give;
  3216.     end link5;
  3217.     task link6 is
  3218.         entry give;
  3219.     end link6;
  3220.     task link7 is
  3221.         entry give;
  3222.     end link7;
  3223.     task link8 is
  3224.         entry give;
  3225.     end link8;
  3226.     task link9 is
  3227.         entry give;
  3228.     end link9;
  3229.     task link10 is
  3230.         entry give;
  3231.     end link10;
  3232.     task link11 is
  3233.         entry give;
  3234.     end link11;
  3235.     task link12 is
  3236.         entry give;
  3237.     end link12;
  3238.     task link13 is
  3239.         entry give;
  3240.     end link13;
  3241.     task link14 is
  3242.         entry give;
  3243.     end link14;
  3244.     task link15 is
  3245.         entry give;
  3246.     end link15;
  3247.     task link16 is
  3248.         entry give;
  3249.     end link16;
  3250.     task link17 is
  3251.         entry give;
  3252.     end link17;
  3253.     task link18 is
  3254.         entry give;
  3255.     end link18;
  3256.     task link19 is
  3257.         entry give;
  3258.     end link19;
  3259.     task link20 is
  3260.         entry give;
  3261.     end link20;
  3262.  
  3263.     task body head is
  3264.         begin
  3265.             put("do you want printing (y/n)? ");
  3266.             get(answer);
  3267.     put("answer is "); put(answer); put_line(" ");
  3268.             if answer='y' then
  3269.                 printon := true;
  3270.             else
  3271.                 printon := false;
  3272.             end if;
  3273.     if printon then put_line("printing on"); else put_line("print off");
  3274.     end if;
  3275.             put("how many cycles? ");
  3276. -- doesn't work            get_line(cycles);
  3277.             cycles := 1000;
  3278.  
  3279.             put_line("started");
  3280.             for i in 1..cycles loop
  3281.                 if printon then put_line("head"); end if;
  3282.                 link1.give;
  3283.                 link2.give;
  3284.                 link3.give;
  3285.                 link4.give;
  3286.                 link5.give;
  3287.                 link6.give;
  3288.                 link7.give;
  3289.                 link8.give;
  3290.                 link9.give;
  3291.                 link10.give;
  3292.                 link11.give;
  3293.                 link12.give;
  3294.                 link13.give;
  3295.                 link14.give;
  3296.                 link15.give;
  3297.                 link16.give;
  3298.                 link17.give;
  3299.                 link18.give;
  3300.                 link19.give;
  3301.                 link20.give;
  3302.             end loop;
  3303.             put_line("ended");
  3304.         end head;
  3305.  
  3306.     task body link1 is
  3307.         begin
  3308.             loop
  3309.                 accept give do 
  3310.                         null;
  3311.                 end give;
  3312.             end loop;
  3313.         end link1;
  3314.  
  3315.     task body link2 is
  3316.         begin
  3317.             loop
  3318.                 accept give do 
  3319.                         null;
  3320.                 end give;
  3321.             end loop;
  3322.         end link2;
  3323.  
  3324.     task body link3 is
  3325.         begin
  3326.             loop
  3327.                 accept give do 
  3328.                         null;
  3329.                 end give;
  3330.             end loop;
  3331.         end link3;
  3332.  
  3333.     task body link4 is
  3334.         begin
  3335.             loop
  3336.                 accept give do 
  3337.                         null;
  3338.                 end give;
  3339.             end loop;
  3340.         end link4;
  3341.  
  3342.     task body link5 is
  3343.         begin
  3344.             loop
  3345.                 accept give do 
  3346.                         null;
  3347.                 end give;
  3348.             end loop;
  3349.         end link5;
  3350.  
  3351.     task body link6 is
  3352.         begin
  3353.             loop
  3354.                 accept give do 
  3355.                         null;
  3356.                 end give;
  3357.             end loop;
  3358.         end link6;
  3359.  
  3360.     task body link7 is
  3361.         begin
  3362.             loop
  3363.                 accept give do 
  3364.                         null;
  3365.                 end give;
  3366.             end loop;
  3367.         end link7;
  3368.  
  3369.     task body link8 is
  3370.         begin
  3371.             loop
  3372.                 accept give do 
  3373.                         null;
  3374.                 end give;
  3375.             end loop;
  3376.         end link8;
  3377.  
  3378.     task body link9 is
  3379.         begin
  3380.             loop
  3381.                 accept give do 
  3382.                         null;
  3383.                 end give;
  3384.             end loop;
  3385.         end link9;
  3386.  
  3387.     task body link10 is
  3388.         begin
  3389.             loop
  3390.                 accept give do 
  3391.                         null;
  3392.                 end give;
  3393.             end loop;
  3394.         end link10;
  3395.  
  3396.     task body link11 is
  3397.         begin
  3398.             loop
  3399.                 accept give do 
  3400.                         null;
  3401.                 end give;
  3402.             end loop;
  3403.         end link11;
  3404.  
  3405.     task body link12 is
  3406.         begin
  3407.             loop
  3408.                 accept give do 
  3409.                         null;
  3410.                 end give;
  3411.             end loop;
  3412.         end link12;
  3413.  
  3414.     task body link13 is
  3415.         begin
  3416.             loop
  3417.                 accept give do 
  3418.                         null;
  3419.                 end give;
  3420.             end loop;
  3421.         end link13;
  3422.  
  3423.     task body link14 is
  3424.         begin
  3425.             loop
  3426.                 accept give do 
  3427.                         null;
  3428.                 end give;
  3429.             end loop;
  3430.         end link14;
  3431.  
  3432.     task body link15 is
  3433.         begin
  3434.             loop
  3435.                 accept give do 
  3436.                         null;
  3437.                 end give;
  3438.             end loop;
  3439.         end link15;
  3440.  
  3441.     task body link16 is
  3442.         begin
  3443.             loop
  3444.                 accept give do 
  3445.                         null;
  3446.                 end give;
  3447.             end loop;
  3448.         end link16;
  3449.  
  3450.     task body link17 is
  3451.         begin
  3452.             loop
  3453.                 accept give do 
  3454.                         null;
  3455.                 end give;
  3456.             end loop;
  3457.         end link17;
  3458.  
  3459.     task body link18 is
  3460.         begin
  3461.             loop
  3462.                 accept give do 
  3463.                         null;
  3464.                 end give;
  3465.             end loop;
  3466.         end link18;
  3467.  
  3468.     task body link19 is
  3469.         begin
  3470.             loop
  3471.                 accept give do 
  3472.                         null;
  3473.                 end give;
  3474.             end loop;
  3475.         end link19;
  3476.  
  3477.     task body link20 is
  3478.         begin
  3479.             loop
  3480.                 accept give do 
  3481.                         null;
  3482.                 end give;
  3483.             end loop;
  3484.         end link20;
  3485.  
  3486.  
  3487. begin
  3488.     null;
  3489. end test;
  3490.  
  3491.  
  3492. **********************************************************************
  3493. *                            NEXT PROGRAM                            *
  3494. **********************************************************************
  3495.  
  3496.  
  3497. ***** MORETASKSL *****
  3498.  
  3499. -- ada tasking tester
  3500. -- task head is the controller
  3501. -- tasks link are the chain of tasks
  3502. -- tasks idle are the standby tasks
  3503.  
  3504. with text_io; use text_io;
  3505.  
  3506. procedure test is
  3507.     cycles: integer;
  3508.     printon: boolean;
  3509.     answer: character;
  3510.  
  3511.     task head;
  3512.  
  3513.     task link1 is
  3514.         entry give;
  3515.     end link1;
  3516.     task link2 is
  3517.         entry give;
  3518.     end link2;
  3519.     task link3 is
  3520.         entry give;
  3521.     end link3;
  3522.     task link4 is
  3523.         entry give;
  3524.     end link4;
  3525.     task link5 is
  3526.         entry give;
  3527.     end link5;
  3528.     task link6 is
  3529.         entry give;
  3530.     end link6;
  3531.     task link7 is
  3532.         entry give;
  3533.     end link7;
  3534.     task link8 is
  3535.         entry give;
  3536.     end link8;
  3537.     task link9 is
  3538.         entry give;
  3539.     end link9;
  3540.     task link10 is
  3541.         entry give;
  3542.     end link10;
  3543.     task link11 is
  3544.         entry give;
  3545.     end link11;
  3546.     task link12 is
  3547.         entry give;
  3548.     end link12;
  3549.     task link13 is
  3550.         entry give;
  3551.     end link13;
  3552.     task link14 is
  3553.         entry give;
  3554.     end link14;
  3555.     task link15 is
  3556.         entry give;
  3557.     end link15;
  3558.     task link16 is
  3559.         entry give;
  3560.     end link16;
  3561.     task link17 is
  3562.         entry give;
  3563.     end link17;
  3564.     task link18 is
  3565.         entry give;
  3566.     end link18;
  3567.     task link19 is
  3568.         entry give;
  3569.     end link19;
  3570.     task link20 is
  3571.         entry give;
  3572.     end link20;
  3573.  
  3574.     task body head is
  3575.         begin
  3576.             put("do you want printing (y/n)? ");
  3577.             get(answer);
  3578.     put("answer is "); put(answer); put_line(" ");
  3579.             if answer='y' then
  3580.                 printon := true;
  3581.             else
  3582.                 printon := false;
  3583.             end if;
  3584.     if printon then put_line("printing on"); else put_line("print off");
  3585.     end if;
  3586.             put("how many cycles? ");
  3587. -- doesn't work            get_line(cycles);
  3588.             cycles := 1000;
  3589.  
  3590.             put_line("started");
  3591.             for i in 1..cycles loop
  3592.                 if printon then put_line("head"); end if;
  3593.                 link1.give;
  3594.                 link2.give;
  3595.                 link3.give;
  3596.                 link4.give;
  3597.                 link5.give;
  3598.                 link6.give;
  3599.                 link7.give;
  3600.                 link8.give;
  3601.                 link9.give;
  3602.                 link10.give;
  3603.                 link11.give;
  3604.                 link12.give;
  3605.                 link13.give;
  3606.                 link14.give;
  3607.                 link15.give;
  3608.                 link16.give;
  3609.                 link17.give;
  3610.                 link18.give;
  3611.                 link19.give;
  3612.                 link20.give;
  3613.             end loop;
  3614.             put_line("ended");
  3615.         end head;
  3616.  
  3617.     task body link1 is
  3618.         begin
  3619.             loop
  3620.             select accept give do null; end give; end select;
  3621.             end loop;
  3622.         end link1;
  3623.  
  3624.     task body link2 is
  3625.         begin
  3626.             loop
  3627.             select accept give do null; end give; end select;
  3628.             end loop;
  3629.         end link2;
  3630.  
  3631.     task body link3 is
  3632.         begin
  3633.             loop
  3634.             select accept give do null; end give; end select;
  3635.             end loop;
  3636.         end link3;
  3637.  
  3638.     task body link4 is
  3639.         begin
  3640.             loop
  3641.             select accept give do null; end give; end select;
  3642.             end loop;
  3643.         end link4;
  3644.  
  3645.     task body link5 is
  3646.         begin
  3647.             loop
  3648.             select accept give do null; end give; end select;
  3649.             end loop;
  3650.         end link5;
  3651.  
  3652.     task body link6 is
  3653.         begin
  3654.             loop
  3655.             select accept give do null; end give; end select;
  3656.             end loop;
  3657.         end link6;
  3658.  
  3659.     task body link7 is
  3660.         begin
  3661.             loop
  3662.             select accept give do null; end give; end select;
  3663.             end loop;
  3664.         end link7;
  3665.  
  3666.     task body link8 is
  3667.         begin
  3668.             loop
  3669.             select accept give do null; end give; end select;
  3670.             end loop;
  3671.         end link8;
  3672.  
  3673.     task body link9 is
  3674.         begin
  3675.             loop
  3676.             select accept give do null; end give; end select;
  3677.             end loop;
  3678.         end link9;
  3679.  
  3680.     task body link10 is
  3681.         begin
  3682.             loop
  3683.             select accept give do null; end give; end select;
  3684.             end loop;
  3685.         end link10;
  3686.  
  3687.     task body link11 is
  3688.         begin
  3689.             loop
  3690.             select accept give do null; end give; end select;
  3691.             end loop;
  3692.         end link11;
  3693.  
  3694.     task body link12 is
  3695.         begin
  3696.             loop
  3697.             select accept give do null; end give; end select;
  3698.             end loop;
  3699.         end link12;
  3700.  
  3701.     task body link13 is
  3702.         begin
  3703.             loop
  3704.             select accept give do null; end give; end select;
  3705.             end loop;
  3706.         end link13;
  3707.  
  3708.     task body link14 is
  3709.         begin
  3710.             loop
  3711.             select accept give do null; end give; end select;
  3712.             end loop;
  3713.         end link14;
  3714.  
  3715.     task body link15 is
  3716.         begin
  3717.             loop
  3718.             select accept give do null; end give; end select;
  3719.             end loop;
  3720.         end link15;
  3721.  
  3722.     task body link16 is
  3723.         begin
  3724.             loop
  3725.             select accept give do null; end give; end select;
  3726.             end loop;
  3727.         end link16;
  3728.  
  3729.     task body link17 is
  3730.         begin
  3731.             loop
  3732.             select accept give do null; end give; end select;
  3733.             end loop;
  3734.         end link17;
  3735.  
  3736.     task body link18 is
  3737.         begin
  3738.             loop
  3739.             select accept give do null; end give; end select;
  3740.             end loop;
  3741.         end link18;
  3742.  
  3743.     task body link19 is
  3744.         begin
  3745.             loop
  3746.             select accept give do null; end give; end select;
  3747.             end loop;
  3748.         end link19;
  3749.  
  3750.     task body link20 is
  3751.         begin
  3752.             loop
  3753.             select accept give do null; end give; end select;
  3754.             end loop;
  3755.         end link20;
  3756.  
  3757.  
  3758. begin
  3759.     null;
  3760. end test;
  3761.  
  3762.  
  3763. **********************************************************************
  3764. *                            NEXT PROGRAM                            *
  3765. **********************************************************************
  3766.  
  3767.  
  3768. ***** MORESELCT *****
  3769.  
  3770. -- ada tasking tester
  3771. -- task head is the controller
  3772. -- tasks link are the chain of tasks
  3773. -- tasks idle are the standby tasks
  3774.  
  3775. with text_io; use text_io;
  3776.  
  3777. procedure test is
  3778.     cycles: integer;
  3779.     printon: boolean;
  3780.     answer: character;
  3781.  
  3782.     task head;
  3783.  
  3784.     task link1 is
  3785.         entry give1;
  3786.         entry give2;
  3787.         entry give3;
  3788.         entry give4;
  3789.         entry give5;
  3790.         entry give6;
  3791.         entry give7;
  3792.         entry give8;
  3793.         entry give9;
  3794.         entry give10;
  3795.         entry give11;
  3796.         entry give12;
  3797.         entry give13;
  3798.         entry give14;
  3799.         entry give15;
  3800.         entry give16;
  3801.         entry give17;
  3802.         entry give18;
  3803.         entry give19;
  3804.         entry give20;
  3805.     end link1;
  3806.  
  3807.     task body head is
  3808.         begin
  3809.             put("do you want printing (y/n)? ");
  3810.             get(answer);
  3811.     put("answer is "); put(answer); put_line(" ");
  3812.             if answer='y' then
  3813.                 printon := true;
  3814.             else
  3815.                 printon := false;
  3816.             end if;
  3817.     if printon then put_line("printing on"); else put_line("print off");
  3818.     end if;
  3819.             put("how many cycles? ");
  3820. -- doesn't work            get_line(cycles);
  3821.             cycles := 1000;
  3822.  
  3823.             put_line("started");
  3824.             for i in 1..cycles loop
  3825.                 if printon then put_line("head"); end if;
  3826.                 link1.give1;
  3827.                 link1.give2;
  3828.                 link1.give3;
  3829.                 link1.give4;
  3830.                 link1.give5;
  3831.                 link1.give6;
  3832.                 link1.give7;
  3833.                 link1.give8;
  3834.                 link1.give9;
  3835.                 link1.give10;
  3836.                 link1.give11;
  3837.                 link1.give12;
  3838.                 link1.give13;
  3839.                 link1.give14;
  3840.                 link1.give15;
  3841.                 link1.give16;
  3842.                 link1.give17;
  3843.                 link1.give18;
  3844.                 link1.give19;
  3845.                 link1.give20;
  3846.             end loop;
  3847.             put_line("ended");
  3848.         end head;
  3849.  
  3850.     task body link1 is
  3851.         begin
  3852.             loop
  3853.               select
  3854.                 accept give1 do    null;    end give1;
  3855.             or    accept give2 do    null;    end give2;
  3856.             or    accept give3 do    null;    end give3;
  3857.             or    accept give4 do    null;    end give4;
  3858.             or    accept give5 do    null;    end give5;
  3859.             or    accept give6 do    null;    end give6;
  3860.             or    accept give7 do    null;    end give7;
  3861.             or    accept give8 do    null;    end give8;
  3862.             or    accept give9 do    null;    end give9;
  3863.             or    accept give10 do null;    end give10;
  3864.             or    accept give11 do null;    end give11;
  3865.             or    accept give12 do null;    end give12;
  3866.             or    accept give13 do null;    end give13;
  3867.             or    accept give14 do null;    end give14;
  3868.             or    accept give15 do null;    end give15;
  3869.             or    accept give16 do null;    end give16;
  3870.             or    accept give17 do null;    end give17;
  3871.             or    accept give18 do null;    end give18;
  3872.             or    accept give19 do null;    end give19;
  3873.             or    accept give20 do null;    end give20;
  3874.               end select;
  3875.             end loop;
  3876.         end link1;
  3877.  
  3878.  
  3879. begin
  3880.     null;
  3881. end test;
  3882.  
  3883.  
  3884. **********************************************************************
  3885. *                            NEXT PROGRAM                            *
  3886. **********************************************************************
  3887.  
  3888.  
  3889. ***** MORESELCTR *****
  3890.  
  3891. -- ada tasking tester
  3892. -- task head is the controller
  3893. -- tasks link are the chain of tasks
  3894. -- tasks idle are the standby tasks
  3895.  
  3896. with text_io; use text_io;
  3897.  
  3898. procedure test is
  3899.     cycles: integer;
  3900.     printon: boolean;
  3901.     answer: character;
  3902.  
  3903.     task head;
  3904.  
  3905.     task link1 is
  3906.         entry give1;
  3907.         entry give2;
  3908.         entry give3;
  3909.         entry give4;
  3910.         entry give5;
  3911.         entry give6;
  3912.         entry give7;
  3913.         entry give8;
  3914.         entry give9;
  3915.         entry give10;
  3916.         entry give11;
  3917.         entry give12;
  3918.         entry give13;
  3919.         entry give14;
  3920.         entry give15;
  3921.         entry give16;
  3922.         entry give17;
  3923.         entry give18;
  3924.         entry give19;
  3925.         entry give20;
  3926.     end link1;
  3927.  
  3928.     task body head is
  3929.         begin
  3930.             put("do you want printing (y/n)? ");
  3931.             get(answer);
  3932.     put("answer is "); put(answer); put_line(" ");
  3933.             if answer='y' then
  3934.                 printon := true;
  3935.             else
  3936.                 printon := false;
  3937.             end if;
  3938.     if printon then put_line("printing on"); else put_line("print off");
  3939.     end if;
  3940.             put("how many cycles? ");
  3941. -- doesn't work            get_line(cycles);
  3942.             cycles := 1000;
  3943.  
  3944.             put_line("started");
  3945.             for i in 1..cycles loop
  3946.                 if printon then put_line("head"); end if;
  3947.                 link1.give1;
  3948.                 link1.give2;
  3949.                 link1.give3;
  3950.                 link1.give4;
  3951.                 link1.give5;
  3952.                 link1.give6;
  3953.                 link1.give7;
  3954.                 link1.give8;
  3955.                 link1.give9;
  3956.                 link1.give10;
  3957.                 link1.give11;
  3958.                 link1.give12;
  3959.                 link1.give13;
  3960.                 link1.give14;
  3961.                 link1.give15;
  3962.                 link1.give16;
  3963.                 link1.give17;
  3964.                 link1.give18;
  3965.                 link1.give19;
  3966.                 link1.give20;
  3967.             end loop;
  3968.             put_line("ended");
  3969.         end head;
  3970.  
  3971.     task body link1 is
  3972.         begin
  3973.             loop
  3974.               select
  3975.                 accept give20 do null;    end give20;
  3976.             or    accept give19 do null;    end give19;
  3977.             or    accept give18 do null;    end give18;
  3978.             or    accept give17 do null;    end give17;
  3979.             or    accept give16 do null;    end give16;
  3980.             or    accept give15 do null;    end give15;
  3981.             or    accept give14 do null;    end give14;
  3982.             or    accept give13 do null;    end give13;
  3983.             or    accept give12 do null;    end give12;
  3984.             or    accept give11 do null;    end give11;
  3985.             or    accept give10 do null;    end give10;
  3986.             or    accept give9 do    null;    end give9;
  3987.             or    accept give8 do    null;    end give8;
  3988.             or    accept give7 do    null;    end give7;
  3989.             or    accept give6 do    null;    end give6;
  3990.             or    accept give5 do    null;    end give5;
  3991.             or    accept give4 do    null;    end give4;
  3992.             or    accept give3 do    null;    end give3;
  3993.             or    accept give2 do    null;    end give2;
  3994.             or    accept give1 do    null;    end give1;
  3995.               end select;
  3996.             end loop;
  3997.         end link1;
  3998.  
  3999.  
  4000. begin
  4001.     null;
  4002. end test;
  4003.  
  4004.  
  4005. **********************************************************************
  4006. *                            NEXT PROGRAM                            *
  4007. **********************************************************************
  4008.  
  4009.  
  4010. ***** ORDER31 *****
  4011.  
  4012. -- ada tasking tester
  4013. -- task head is the controller
  4014. -- tasks link are the chain of tasks
  4015. -- tasks idle are the standby tasks
  4016.  
  4017. with text_io; use text_io;
  4018.  
  4019. procedure test is
  4020.     cycles: integer;
  4021.     printon: boolean;
  4022.     answer: character;
  4023.  
  4024.     task head;
  4025.  
  4026.     task link1 is
  4027.         entry give1;
  4028.         entry give2;
  4029.         entry give3;
  4030.         entry give4;
  4031.         entry give5;
  4032.         entry give6;
  4033.         entry give7;
  4034.         entry give8;
  4035.         entry give9;
  4036.         entry give10;
  4037.         entry give11;
  4038.         entry give12;
  4039.         entry give13;
  4040.         entry give14;
  4041.         entry give15;
  4042.         entry give16;
  4043.         entry give17;
  4044.         entry give18;
  4045.         entry give19;
  4046.         entry give20;
  4047.         entry give21;
  4048.         entry give22;
  4049.         entry give23;
  4050.         entry give24;
  4051.         entry give25;
  4052.         entry give26;
  4053.         entry give27;
  4054.         entry give28;
  4055.         entry give29;
  4056.         entry give30;
  4057.         entry give31;
  4058.     end link1;
  4059.  
  4060.     task body head is
  4061.         begin
  4062.             put("do you want printing (y/n)? ");
  4063.             get(answer);
  4064.     put("answer is "); put(answer); put_line(" ");
  4065.             if answer='y' then
  4066.                 printon := true;
  4067.             else
  4068.                 printon := false;
  4069.             end if;
  4070.     if printon then put_line("printing on"); else put_line("print off");
  4071.     end if;
  4072.             put("how many cycles? ");
  4073. -- doesn't work            get_line(cycles);
  4074.             cycles := 100;
  4075.  
  4076.             put_line("started");
  4077.             for i in 1..cycles loop
  4078.                 if printon then put_line("head"); end if;
  4079.                 link1.give1;
  4080.                 link1.give2;
  4081.                 link1.give3;
  4082.                 link1.give4;
  4083.                 link1.give5;
  4084.                 link1.give6;
  4085.                 link1.give7;
  4086.                 link1.give8;
  4087.                 link1.give9;
  4088.                 link1.give10;
  4089.                 link1.give11;
  4090.                 link1.give12;
  4091.                 link1.give13;
  4092.                 link1.give14;
  4093.                 link1.give15;
  4094.                 link1.give16;
  4095.                 link1.give17;
  4096.                 link1.give18;
  4097.                 link1.give19;
  4098.                 link1.give20;
  4099.                 link1.give21;
  4100.                 link1.give22;
  4101.                 link1.give23;
  4102.                 link1.give24;
  4103.                 link1.give25;
  4104.                 link1.give26;
  4105.                 link1.give27;
  4106.                 link1.give28;
  4107.                 link1.give29;
  4108.                 link1.give30;
  4109.                 link1.give31;
  4110.             end loop;
  4111.             put_line("ended");
  4112.         end head;
  4113.  
  4114.     task body link1 is
  4115.         begin
  4116.             loop
  4117.               select
  4118.                 accept give1 do    null;    end give1;
  4119.             or    accept give2 do    null;    end give2;
  4120.             or    accept give3 do    null;    end give3;
  4121.             or    accept give4 do    null;    end give4;
  4122.             or    accept give5 do    null;    end give5;
  4123.             or    accept give6 do    null;    end give6;
  4124.             or    accept give7 do    null;    end give7;
  4125.             or    accept give8 do    null;    end give8;
  4126.             or    accept give9 do    null;    end give9;
  4127.             or    accept give10 do null;    end give10;
  4128.             or    accept give11 do null;    end give11;
  4129.             or    accept give12 do null;    end give12;
  4130.             or    accept give13 do null;    end give13;
  4131.             or    accept give14 do null;    end give14;
  4132.             or    accept give15 do null;    end give15;
  4133.             or    accept give16 do null;    end give16;
  4134.             or    accept give17 do null;    end give17;
  4135.             or    accept give18 do null;    end give18;
  4136.             or    accept give19 do null;    end give19;
  4137.             or    accept give20 do null;    end give20;
  4138.             or    accept give21 do    null;    end give1;
  4139.             or    accept give22 do    null;    end give2;
  4140.             or    accept give23 do    null;    end give3;
  4141.             or    accept give24 do    null;    end give4;
  4142.             or    accept give25 do    null;    end give5;
  4143.             or    accept give26 do    null;    end give6;
  4144.             or    accept give27 do    null;    end give7;
  4145.             or    accept give28 do    null;    end give8;
  4146.             or    accept give29 do    null;    end give9;
  4147.             or    accept give30 do null;    end give10;
  4148.             or    accept give31 do null;    end give11;
  4149.               end select;
  4150.             end loop;
  4151.         end link1;
  4152.  
  4153.  
  4154. begin
  4155.     null;
  4156. end test;
  4157.  
  4158.  
  4159. **********************************************************************
  4160. *                            NEXT PROGRAM                            *
  4161. **********************************************************************
  4162.  
  4163.  
  4164. ***** ORDER31R *****
  4165.  
  4166. -- ada tasking tester
  4167. -- task head is the controller
  4168. -- tasks link are the chain of tasks
  4169. -- tasks idle are the standby tasks
  4170.  
  4171. with text_io; use text_io;
  4172.  
  4173. procedure test is
  4174.     cycles: integer;
  4175.     printon: boolean;
  4176.     answer: character;
  4177.  
  4178.     task head;
  4179.  
  4180.     task link1 is
  4181.         entry give1;
  4182.         entry give2;
  4183.         entry give3;
  4184.         entry give4;
  4185.         entry give5;
  4186.         entry give6;
  4187.         entry give7;
  4188.         entry give8;
  4189.         entry give9;
  4190.         entry give10;
  4191.         entry give11;
  4192.         entry give12;
  4193.         entry give13;
  4194.         entry give14;
  4195.         entry give15;
  4196.         entry give16;
  4197.         entry give17;
  4198.         entry give18;
  4199.         entry give19;
  4200.         entry give20;
  4201.         entry give21;
  4202.         entry give22;
  4203.         entry give23;
  4204.         entry give24;
  4205.         entry give25;
  4206.         entry give26;
  4207.         entry give27;
  4208.         entry give28;
  4209.         entry give29;
  4210.         entry give30;
  4211.         entry give31;
  4212.     end link1;
  4213.  
  4214.     task body head is
  4215.         begin
  4216.             put("do you want printing (y/n)? ");
  4217.             get(answer);
  4218.     put("answer is "); put(answer); put_line(" ");
  4219.             if answer='y' then
  4220.                 printon := true;
  4221.             else
  4222.                 printon := false;
  4223.             end if;
  4224.     if printon then put_line("printing on"); else put_line("print off");
  4225.     end if;
  4226.             put("how many cycles? ");
  4227. -- doesn't work            get_line(cycles);
  4228.             cycles := 100;
  4229.  
  4230.             put_line("started");
  4231.             for i in 1..cycles loop
  4232.                 if printon then put_line("head"); end if;
  4233.                 link1.give31;
  4234.                 link1.give30;
  4235.                 link1.give29;
  4236.                 link1.give28;
  4237.                 link1.give27;
  4238.                 link1.give26;
  4239.                 link1.give25;
  4240.                 link1.give24;
  4241.                 link1.give23;
  4242.                 link1.give22;
  4243.                 link1.give21;
  4244.                 link1.give20;
  4245.                 link1.give19;
  4246.                 link1.give18;
  4247.                 link1.give17;
  4248.                 link1.give16;
  4249.                 link1.give15;
  4250.                 link1.give14;
  4251.                 link1.give13;
  4252.                 link1.give12;
  4253.                 link1.give11;
  4254.                 link1.give10;
  4255.                 link1.give9;
  4256.                 link1.give8;
  4257.                 link1.give7;
  4258.                 link1.give6;
  4259.                 link1.give5;
  4260.                 link1.give4;
  4261.                 link1.give3;
  4262.                 link1.give2;
  4263.                 link1.give1;
  4264.             end loop;
  4265.             put_line("ended");
  4266.         end head;
  4267.  
  4268.     task body link1 is
  4269.         begin
  4270.             loop
  4271.               select
  4272.                 accept give1 do    null;    end give1;
  4273.             or    accept give2 do    null;    end give2;
  4274.             or    accept give3 do    null;    end give3;
  4275.             or    accept give4 do    null;    end give4;
  4276.             or    accept give5 do    null;    end give5;
  4277.             or    accept give6 do    null;    end give6;
  4278.             or    accept give7 do    null;    end give7;
  4279.             or    accept give8 do    null;    end give8;
  4280.             or    accept give9 do    null;    end give9;
  4281.             or    accept give10 do null;    end give10;
  4282.             or    accept give11 do null;    end give11;
  4283.             or    accept give12 do null;    end give12;
  4284.             or    accept give13 do null;    end give13;
  4285.             or    accept give14 do null;    end give14;
  4286.             or    accept give15 do null;    end give15;
  4287.             or    accept give16 do null;    end give16;
  4288.             or    accept give17 do null;    end give17;
  4289.             or    accept give18 do null;    end give18;
  4290.             or    accept give19 do null;    end give19;
  4291.             or    accept give20 do null;    end give20;
  4292.             or    accept give21 do    null;    end give1;
  4293.             or    accept give22 do    null;    end give2;
  4294.             or    accept give23 do    null;    end give3;
  4295.             or    accept give24 do    null;    end give4;
  4296.             or    accept give25 do    null;    end give5;
  4297.             or    accept give26 do    null;    end give6;
  4298.             or    accept give27 do    null;    end give7;
  4299.             or    accept give28 do    null;    end give8;
  4300.             or    accept give29 do    null;    end give9;
  4301.             or    accept give30 do null;    end give10;
  4302.             or    accept give31 do null;    end give11;
  4303.               end select;
  4304.             end loop;
  4305.         end link1;
  4306.  
  4307.  
  4308. begin
  4309.     null;
  4310. end test;
  4311.  
  4312.  
  4313. **********************************************************************
  4314. *                            NEXT PROGRAM                            *
  4315. **********************************************************************
  4316.  
  4317.  
  4318. ***** ORDER32 *****
  4319.  
  4320. -- ada tasking tester
  4321. -- task head is the controller
  4322. -- tasks link are the chain of tasks
  4323. -- tasks idle are the standby tasks
  4324.  
  4325. with text_io; use text_io;
  4326.  
  4327. procedure test is
  4328.     cycles: integer;
  4329.     printon: boolean;
  4330.     answer: character;
  4331.  
  4332.     task head;
  4333.  
  4334.     task link1 is
  4335.         entry give1;
  4336.         entry give2;
  4337.         entry give3;
  4338.         entry give4;
  4339.         entry give5;
  4340.         entry give6;
  4341.         entry give7;
  4342.         entry give8;
  4343.         entry give9;
  4344.         entry give10;
  4345.         entry give11;
  4346.         entry give12;
  4347.         entry give13;
  4348.         entry give14;
  4349.         entry give15;
  4350.         entry give16;
  4351.         entry give17;
  4352.         entry give18;
  4353.         entry give19;
  4354.         entry give20;
  4355.         entry give21;
  4356.         entry give22;
  4357.         entry give23;
  4358.         entry give24;
  4359.         entry give25;
  4360.         entry give26;
  4361.         entry give27;
  4362.         entry give28;
  4363.         entry give29;
  4364.         entry give30;
  4365.         entry give31;
  4366.         entry give32;
  4367.     end link1;
  4368.  
  4369.     task body head is
  4370.         begin
  4371.             put("do you want printing (y/n)? ");
  4372.             get(answer);
  4373.     put("answer is "); put(answer); put_line(" ");
  4374.             if answer='y' then
  4375.                 printon := true;
  4376.             else
  4377.                 printon := false;
  4378.             end if;
  4379.     if printon then put_line("printing on"); else put_line("print off");
  4380.     end if;
  4381.             put("how many cycles? ");
  4382. -- doesn't work            get_line(cycles);
  4383.             cycles := 100;
  4384.  
  4385.             put_line("started");
  4386.             for i in 1..cycles loop
  4387.                 if printon then put_line("head"); end if;
  4388.                 link1.give1;
  4389.                 link1.give2;
  4390.                 link1.give3;
  4391.                 link1.give4;
  4392.                 link1.give5;
  4393.                 link1.give6;
  4394.                 link1.give7;
  4395.                 link1.give8;
  4396.                 link1.give9;
  4397.                 link1.give10;
  4398.                 link1.give11;
  4399.                 link1.give12;
  4400.                 link1.give13;
  4401.                 link1.give14;
  4402.                 link1.give15;
  4403.                 link1.give16;
  4404.                 link1.give17;
  4405.                 link1.give18;
  4406.                 link1.give19;
  4407.                 link1.give20;
  4408.                 link1.give21;
  4409.                 link1.give22;
  4410.                 link1.give23;
  4411.                 link1.give24;
  4412.                 link1.give25;
  4413.                 link1.give26;
  4414.                 link1.give27;
  4415.                 link1.give28;
  4416.                 link1.give29;
  4417.                 link1.give30;
  4418.                 link1.give31;
  4419.                 link1.give32;
  4420.             end loop;
  4421.             put_line("ended");
  4422.         end head;
  4423.  
  4424.     task body link1 is
  4425.         begin
  4426.             loop
  4427.               select
  4428.                 accept give1 do    null;    end give1;
  4429.             or    accept give2 do    null;    end give2;
  4430.             or    accept give3 do    null;    end give3;
  4431.             or    accept give4 do    null;    end give4;
  4432.             or    accept give5 do    null;    end give5;
  4433.             or    accept give6 do    null;    end give6;
  4434.             or    accept give7 do    null;    end give7;
  4435.             or    accept give8 do    null;    end give8;
  4436.             or    accept give9 do    null;    end give9;
  4437.             or    accept give10 do null;    end give10;
  4438.             or    accept give11 do null;    end give11;
  4439.             or    accept give12 do null;    end give12;
  4440.             or    accept give13 do null;    end give13;
  4441.             or    accept give14 do null;    end give14;
  4442.             or    accept give15 do null;    end give15;
  4443.             or    accept give16 do null;    end give16;
  4444.             or    accept give17 do null;    end give17;
  4445.             or    accept give18 do null;    end give18;
  4446.             or    accept give19 do null;    end give19;
  4447.             or    accept give20 do null;    end give20;
  4448.             or    accept give21 do    null;    end give1;
  4449.             or    accept give22 do    null;    end give2;
  4450.             or    accept give23 do    null;    end give3;
  4451.             or    accept give24 do    null;    end give4;
  4452.             or    accept give25 do    null;    end give5;
  4453.             or    accept give26 do    null;    end give6;
  4454.             or    accept give27 do    null;    end give7;
  4455.             or    accept give28 do    null;    end give8;
  4456.             or    accept give29 do    null;    end give9;
  4457.             or    accept give30 do null;    end give10;
  4458.             or    accept give31 do null;    end give11;
  4459.             or    accept give32 do null;    end give12;
  4460.               end select;
  4461.             end loop;
  4462.         end link1;
  4463.  
  4464.  
  4465. begin
  4466.     null;
  4467. end test;
  4468.  
  4469.  
  4470. **********************************************************************
  4471. *                            NEXT PROGRAM                            *
  4472. **********************************************************************
  4473.  
  4474.  
  4475.  
  4476. ***** ORDER100 *****
  4477.  
  4478. *
  4479. -- ada tasking tester
  4480. -- task head is the controller
  4481. -- tasks link are the chain of tasks
  4482. -- tasks idle are the standby tasks
  4483.  
  4484. with text_io; use text_io;
  4485.  
  4486. procedure test is
  4487.     cycles: integer;
  4488.     printon: boolean;
  4489.     answer: character;
  4490.  
  4491.     task head;
  4492.  
  4493.     task link1 is
  4494.         entry give1;
  4495.         entry give2;
  4496.         entry give3;
  4497.         entry give4;
  4498.         entry give5;
  4499.         entry give6;
  4500.         entry give7;
  4501.         entry give8;
  4502.         entry give9;
  4503.         entry give10;
  4504.         entry give11;
  4505.         entry give12;
  4506.         entry give13;
  4507.         entry give14;
  4508.         entry give15;
  4509.         entry give16;
  4510.         entry give17;
  4511.         entry give18;
  4512.         entry give19;
  4513.         entry give20;
  4514.         entry give21;
  4515.         entry give22;
  4516.         entry give23;
  4517.         entry give24;
  4518.         entry give25;
  4519.         entry give26;
  4520.         entry give27;
  4521.         entry give28;
  4522.         entry give29;
  4523.         entry give30;
  4524.         entry give31;
  4525.         entry give32;
  4526.         entry give33;
  4527.         entry give34;
  4528.         entry give35;
  4529.         entry give36;
  4530.         entry give37;
  4531.         entry give38;
  4532.         entry give39;
  4533.         entry give40;
  4534.         entry give41;
  4535.         entry give42;
  4536.         entry give43;
  4537.         entry give44;
  4538.         entry give45;
  4539.         entry give46;
  4540.         entry give47;
  4541.         entry give48;
  4542.         entry give49;
  4543.         entry give50;
  4544.         entry give51;
  4545.         entry give52;
  4546.         entry give53;
  4547.         entry give54;
  4548.         entry give55;
  4549.         entry give56;
  4550.         entry give57;
  4551.         entry give58;
  4552.         entry give59;
  4553.         entry give60;
  4554.         entry give61;
  4555.         entry give62;
  4556.         entry give63;
  4557.         entry give64;
  4558.         entry give65;
  4559.         entry give66;
  4560.         entry give67;
  4561.         entry give68;
  4562.         entry give69;
  4563.         entry give70;
  4564.         entry give71;
  4565.         entry give72;
  4566.         entry give73;
  4567.         entry give74;
  4568.         entry give75;
  4569.         entry give76;
  4570.         entry give77;
  4571.         entry give78;
  4572.         entry give79;
  4573.         entry give80;
  4574.         entry give81;
  4575.         entry give82;
  4576.         entry give83;
  4577.         entry give84;
  4578.         entry give85;
  4579.         entry give86;
  4580.         entry give87;
  4581.         entry give88;
  4582.         entry give89;
  4583.         entry give90;
  4584.         entry give91;
  4585.         entry give92;
  4586.         entry give93;
  4587.         entry give94;
  4588.         entry give95;
  4589.         entry give96;
  4590.         entry give97;
  4591.         entry give98;
  4592.         entry give99;
  4593.         entry give100;
  4594.     end link1;
  4595.  
  4596.     task body head is
  4597.         begin
  4598.             put("do you want printing (y/n)? ");
  4599.             get(answer);
  4600.     put("answer is "); put(answer); put_line(" ");
  4601.             if answer='y' then
  4602.                 printon := true;
  4603.             else
  4604.                 printon := false;
  4605.             end if;
  4606.     if printon then put_line("printing on"); else put_line("print off");
  4607.     end if;
  4608.             put("how many cycles? ");
  4609. -- doesn't work            get_line(cycles);
  4610.             cycles := 100;
  4611.  
  4612.             put_line("started");
  4613.             for i in 1..cycles loop
  4614.                 if printon then put_line("head"); end if;
  4615.                 link1.give1;
  4616.                 link1.give2;
  4617.                 link1.give3;
  4618.                 link1.give4;
  4619.                 link1.give5;
  4620.                 link1.give6;
  4621.                 link1.give7;
  4622.                 link1.give8;
  4623.                 link1.give9;
  4624.                 link1.give10;
  4625.                 link1.give11;
  4626.                 link1.give12;
  4627.                 link1.give13;
  4628.                 link1.give14;
  4629.                 link1.give15;
  4630.                 link1.give16;
  4631.                 link1.give17;
  4632.                 link1.give18;
  4633.                 link1.give19;
  4634.                 link1.give20;
  4635.                 link1.give21;
  4636.                 link1.give22;
  4637.                 link1.give23;
  4638.                 link1.give24;
  4639.                 link1.give25;
  4640.                 link1.give26;
  4641.                 link1.give27;
  4642.                 link1.give28;
  4643.                 link1.give29;
  4644.                 link1.give30;
  4645.                 link1.give31;
  4646.                 link1.give32;
  4647.                 link1.give33;
  4648.                 link1.give34;
  4649.                 link1.give35;
  4650.                 link1.give36;
  4651.                 link1.give37;
  4652.                 link1.give38;
  4653.                 link1.give39;
  4654.                 link1.give40;
  4655.                 link1.give41;
  4656.                 link1.give42;
  4657.                 link1.give43;
  4658.                 link1.give44;
  4659.                 link1.give45;
  4660.                 link1.give46;
  4661.                 link1.give47;
  4662.                 link1.give48;
  4663.                 link1.give49;
  4664.                 link1.give50;
  4665.                 link1.give51;
  4666.                 link1.give52;
  4667.                 link1.give53;
  4668.                 link1.give54;
  4669.                 link1.give55;
  4670.                 link1.give56;
  4671.                 link1.give57;
  4672.                 link1.give58;
  4673.                 link1.give59;
  4674.                 link1.give60;
  4675.                 link1.give61;
  4676.                 link1.give62;
  4677.                 link1.give63;
  4678.                 link1.give64;
  4679.                 link1.give65;
  4680.                 link1.give66;
  4681.                 link1.give67;
  4682.                 link1.give68;
  4683.                 link1.give69;
  4684.                 link1.give70;
  4685.                 link1.give71;
  4686.                 link1.give72;
  4687.                 link1.give73;
  4688.                 link1.give74;
  4689.                 link1.give75;
  4690.                 link1.give76;
  4691.                 link1.give77;
  4692.                 link1.give78;
  4693.                 link1.give79;
  4694.                 link1.give80;
  4695.                 link1.give81;
  4696.                 link1.give82;
  4697.                 link1.give83;
  4698.                 link1.give84;
  4699.                 link1.give85;
  4700.                 link1.give86;
  4701.                 link1.give87;
  4702.                 link1.give88;
  4703.                 link1.give89;
  4704.                 link1.give90;
  4705.                 link1.give91;
  4706.                 link1.give92;
  4707.                 link1.give93;
  4708.                 link1.give94;
  4709.                 link1.give95;
  4710.                 link1.give96;
  4711.                 link1.give97;
  4712.                 link1.give98;
  4713.                 link1.give99;
  4714.                 link1.give100;
  4715.             end loop;
  4716.             put_line("ended");
  4717.         end head;
  4718.  
  4719.     task body link1 is
  4720.         begin
  4721.             loop
  4722.               select
  4723.                 accept give1 do    null;    end give1;
  4724.             or    accept give2 do    null;    end give2;
  4725.             or    accept give3 do    null;    end give3;
  4726.             or    accept give4 do    null;    end give4;
  4727.             or    accept give5 do    null;    end give5;
  4728.             or    accept give6 do    null;    end give6;
  4729.             or    accept give7 do    null;    end give7;
  4730.             or    accept give8 do    null;    end give8;
  4731.             or    accept give9 do    null;    end give9;
  4732.             or    accept give10 do null;    end give10;
  4733.             or    accept give11 do null;    end give11;
  4734.             or    accept give12 do null;    end give12;
  4735.             or    accept give13 do null;    end give13;
  4736.             or    accept give14 do null;    end give14;
  4737.             or    accept give15 do null;    end give15;
  4738.             or    accept give16 do null;    end give16;
  4739.             or    accept give17 do null;    end give17;
  4740.             or    accept give18 do null;    end give18;
  4741.             or    accept give19 do null;    end give19;
  4742.             or    accept give20 do null;    end give20;
  4743.             or    accept give21 do    null;    end give1;
  4744.             or    accept give22 do    null;    end give2;
  4745.             or    accept give23 do    null;    end give3;
  4746.             or    accept give24 do    null;    end give4;
  4747.             or    accept give25 do    null;    end give5;
  4748.             or    accept give26 do    null;    end give6;
  4749.             or    accept give27 do    null;    end give7;
  4750.             or    accept give28 do    null;    end give8;
  4751.             or    accept give29 do    null;    end give9;
  4752.             or    accept give30 do null;    end give10;
  4753.             or    accept give31 do null;    end give11;
  4754.             or    accept give32 do null;    end give12;
  4755.             or    accept give33 do null;    end give13;
  4756.             or    accept give34 do null;    end give14;
  4757.             or    accept give35 do null;    end give15;
  4758.             or    accept give36 do null;    end give16;
  4759.             or    accept give37 do null;    end give17;
  4760.             or    accept give38 do null;    end give18;
  4761.             or    accept give39 do null;    end give19;
  4762.             or    accept give40 do null;    end give20;
  4763.             or    accept give41 do    null;    end give1;
  4764.             or    accept give42 do    null;    end give2;
  4765.             or    accept give43 do    null;    end give3;
  4766.             or    accept give44 do    null;    end give4;
  4767.             or    accept give45 do    null;    end give5;
  4768.             or    accept give46 do    null;    end give6;
  4769.             or    accept give47 do    null;    end give7;
  4770.             or    accept give48 do    null;    end give8;
  4771.             or    accept give49 do    null;    end give9;
  4772.             or    accept give50 do null;    end give10;
  4773.             or    accept give51 do null;    end give11;
  4774.             or    accept give52 do null;    end give12;
  4775.             or    accept give53 do null;    end give13;
  4776.             or    accept give54 do null;    end give14;
  4777.             or    accept give55 do null;    end give15;
  4778.             or    accept give56 do null;    end give16;
  4779.             or    accept give57 do null;    end give17;
  4780.             or    accept give58 do null;    end give18;
  4781.             or    accept give59 do null;    end give19;
  4782.             or    accept give60 do null;    end give20;
  4783.             or    accept give61 do    null;    end give1;
  4784.             or    accept give62 do    null;    end give2;
  4785.             or    accept give63 do    null;    end give3;
  4786.             or    accept give64 do    null;    end give4;
  4787.             or    accept give65 do    null;    end give5;
  4788.             or    accept give66 do    null;    end give6;
  4789.             or    accept give67 do    null;    end give7;
  4790.             or    accept give68 do    null;    end give8;
  4791.             or    accept give69 do    null;    end give9;
  4792.             or    accept give70 do null;    end give10;
  4793.             or    accept give71 do null;    end give11;
  4794.             or    accept give72 do null;    end give12;
  4795.             or    accept give73 do null;    end give13;
  4796.             or    accept give74 do null;    end give14;
  4797.             or    accept give75 do null;    end give15;
  4798.             or    accept give76 do null;    end give16;
  4799.             or    accept give77 do null;    end give17;
  4800.             or    accept give78 do null;    end give18;
  4801.             or    accept give79 do null;    end give19;
  4802.             or    accept give80 do null;    end give20;
  4803.             or    accept give81 do    null;    end give1;
  4804.             or    accept give82 do    null;    end give2;
  4805.             or    accept give83 do    null;    end give3;
  4806.             or    accept give84 do    null;    end give4;
  4807.             or    accept give85 do    null;    end give5;
  4808.             or    accept give86 do    null;    end give6;
  4809.             or    accept give87 do    null;    end give7;
  4810.             or    accept give88 do    null;    end give8;
  4811.             or    accept give89 do    null;    end give9;
  4812.             or    accept give90 do null;    end give10;
  4813.             or    accept give91 do null;    end give11;
  4814.             or    accept give92 do null;    end give12;
  4815.             or    accept give93 do null;    end give13;
  4816.             or    accept give94 do null;    end give14;
  4817.             or    accept give95 do null;    end give15;
  4818.             or    accept give96 do null;    end give16;
  4819.             or    accept give97 do null;    end give17;
  4820.             or    accept give98 do null;    end give18;
  4821.             or    accept give99 do null;    end give19;
  4822.             or    accept give100 do null;    end give20;
  4823.               end select;
  4824.             end loop;
  4825.         end link1;
  4826.  
  4827.  
  4828. begin
  4829.     null;
  4830. end test;
  4831.  
  4832.  
  4833. **********************************************************************
  4834. *                            NEXT PROGRAM                            *
  4835. **********************************************************************
  4836.  
  4837.  
  4838. ***** SCHEDTEST *****
  4839.  
  4840. -- schedtest : see if any tasks get starved
  4841. --
  4842. --    t1----------->slave<------------t3
  4843. --      t2----------->
  4844. --
  4845. --    t1 & t2 call entry1 in slave, t3 calls entry2
  4846. --    slave aborts after entered 1000 times
  4847.  
  4848.  
  4849. with text_io; use text_io;
  4850.  
  4851. procedure test is
  4852.     cycles: integer;
  4853.     printon: boolean;
  4854.     answer: character;
  4855.     call1: integer;
  4856.     call2: integer;
  4857.  
  4858.     task slave is
  4859.         entry entry1;
  4860.         entry entry2;
  4861.     end slave;
  4862.  
  4863.     task t1 is end t1;
  4864.     task t2 is end t2;
  4865.     task t3 is end t3;
  4866.  
  4867.     task body t3 is
  4868.         begin
  4869.             loop
  4870.                 if printon then put_line("t3"); end if;
  4871.                 slave.entry2;
  4872.             end loop;
  4873.         end t3;
  4874.  
  4875.     task body slave is
  4876.         begin
  4877.             put("do you want printing (y/n)? ");
  4878.             get(answer);
  4879.     put("answer is "); put(answer); put_line(" ");
  4880.             if answer='y' then
  4881.                 printon := true;
  4882.             else
  4883.                 printon := false;
  4884.             end if;
  4885.     if printon then put_line("printing on"); else put_line("print off");
  4886.     end if;
  4887.             call1 := 0;
  4888.             call2 := 0;
  4889.             put("how many cycles? ");
  4890. -- doesn't work            get_line(cycles);
  4891.             cycles := 1000;
  4892.  
  4893.             put_line("started");
  4894.             for i in 1..cycles loop
  4895.                 select
  4896.                     accept entry1 do 
  4897.                         call1 := call1 + 1;
  4898.             if printon then put_line("slave entry1"); end if;
  4899.                     end entry1;
  4900.                     or
  4901.                     accept entry2 do 
  4902.                         call2 := call2 + 1;
  4903.             if printon then put_line("slave entry2"); end if;
  4904.                     end entry2;
  4905.                 end select;
  4906.             end loop;
  4907.             put_line("ended");
  4908. --            put("entry1="); 
  4909. --            put(call1); 
  4910. --            put("  entry2=");
  4911. --            put(call2);
  4912.         end slave;
  4913.  
  4914.     task body t1 is
  4915.         begin
  4916.             loop
  4917.                 if printon then put_line("t1"); end if;
  4918.                 slave.entry1;
  4919.             end loop;
  4920.         end t1;
  4921.  
  4922.     task body t2 is
  4923.         begin
  4924.             loop
  4925.                 if printon then put_line("t2"); end if;
  4926.                 slave.entry1;
  4927.             end loop;
  4928.         end t2;
  4929.  
  4930.  
  4931.  
  4932. begin
  4933.     null;
  4934. end test;
  4935.