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,4c86cf2332cbe682 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-02-01 13:48:13 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!Germany.EU.net!howland.reston.ans.net!news.moneng.mei.com!hookup!olivea!news.hal.COM!decwrl!enews.sgi.com!wdl1!wdl1!mab From: mab@wdl1.wdl.loral.com (Mark A Biggar) Subject: Re: Ada.strings.bounded problems? Message-ID: <1995Feb1.214813.14642@wdl.loral.com> Sender: news@wdl.loral.com Organization: Loral Western Development Labs References: Date: Wed, 1 Feb 1995 21:48:13 GMT Date: 1995-02-01T21:48:13+00:00 List-Id: In article brennan@panther.warm.inmet.com (William Brennan) writes: >Please, what are "passive tasks"? (Non-periodic ones?) >Why is it important for the optimizer to recognize them? A "passive task" is one that does nothing significant outside of any of its accept statements; such a task doesn't really need a separate thread of control as it can do all its work piggy backed on the thread of control of any task that calls one of its entries. A simple example is: task foo is entry a; entry b; end foo; task body foo is begin loop select accept a do -- do task operation a end a; or accept b do -- do task operation b end b; end select; end loop; end foo; The simple buffer tasks often required by the Ada tasking model a usually passive tasks. Recognizing that a task is passive can greatly reduce the amount of code necessary to be generated for it and also reduces the run time burden on the tasking run time system. That this optimization can be so useful is one of the reasons that "protected objects" were added to the Ada95 specification. -- Mark Biggar mab@wdl.loral.com