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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3d841c019952cb X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-01 22:48:29 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: ADA Tasks Date: Sun, 01 Dec 2002 22:56:09 -0800 Organization: AdaWorks Software Engineering Message-ID: <3DEB0409.E259CD24@adaworks.com> References: Reply-To: richard@adaworks.com NNTP-Posting-Host: 41.b2.60.05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 2 Dec 2002 06:48:28 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:31335 Date: 2002-12-02T06:48:28+00:00 List-Id: Khuram Imtiaz wrote: > Is it possible to have tasks which contain both (entries/accepts and > calls).Could this be a bad idea? If so, why? can someone explain it > with a pseudo code. I would appreciate your help in this regard. An important point to remember about an entry is that it has a queue. A subprogram does not have a queue. In concurrency this is important because an entry call is not a call for immediate action. Rather, an entry call simply places an entry ( a request for action) in the queue. Almost every other mechanism in tasking relies on this simple idea. For example, timed entry calls, conditional entry calls, asynchronous transfer of control, etc. all depend on the notion of an entry queue. If a task had a subprogram, we would expect an immediate response upon calling it. At the very least, we would expect the call to be re-entrant. That would have some strange implications for any active object (task). On the other hand, a passive object (protected object) can accomodate the mixture of entries and subprograms quite easily. Hope this is helpful. Richard Riehle