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

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