From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8a3e2ce4e6d56336 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-08 19:36:59 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!206.252.192.28!news.stealth.net!204.127.161.2.MISMATCH!wn2feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3AA84FC7.CE523E9D@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Generic Formal Parameter for a Task Type References: <3AA80A68.A2C8B042@worldnet.att.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 09 Mar 2001 03:34:36 GMT NNTP-Posting-Host: 12.74.128.252 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 984108876 12.74.128.252 (Fri, 09 Mar 2001 03:34:36 GMT) NNTP-Posting-Date: Fri, 09 Mar 2001 03:34:36 GMT Organization: AT&T Worldnet Xref: supernews.google.com comp.lang.ada:5560 Date: 2001-03-09T03:34:36+00:00 List-Id: The problem with using a formal limited private type is in the need to determine if one of the tasks being monitored has terminated. The 'Terminated attribute only applies to Task objects, either directly, or implicitly through an access to the task object. A limited private type is too general. It is not viewed within the generic as a task type. I know. I tried this first. The only way to make such a system work is to creat a limited record type containing an access to task type. You could then create a function taking a parameter of the record type, returning the proper response from the 'Terminated attribute. Although this is easily done, it is not what I wanted. I had hoped to be able to create a generic package directly usable with most any task type. This appears to be one problem not solvable in Ada, yet easily solved in Java. I would like to add a generic task type formal parameter to the list of improvements for the next version of Ada. Jim Rogers Colorado Springs, Colorado USA Pat Rogers wrote: > > "James Rogers" wrote in message > news:3AA80A68.A2C8B042@worldnet.att.net... > > I have looked through "Ada as a Second Language" and the Ada Reference > > manual. I cannot find any proper form to pass a task type as a > > generic formal parameter. > > > > Is there a generic formal parameter form for this purpose? > > > > I wanted to create a generic package I call Task_Governor. This > > package would control the number of tasks one could create at once. > > The idea is that task resources may be limited. This package would > > allow someone to limit the number of tasks to a maximum specified. > > An instantiation of the package would monitor the tasks it started > > and allow another to be started when one of the tasks terminated. > > > > My problem is that I cannot figure out how to specify a task type > > as a generic formal parameter. > > There is no generic formal task type; you have to use a limited private > formal. > > --- > Patrick Rogers Consulting and Training in: > http://www.classwide.com Real-Time/OO Languages > progers@classwide.com Hard Deadline Schedulability Analysis > (281)648-3165 Software Fault Tolerance