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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b4731a3b5d591abd X-Google-Attributes: gid103376,public From: "John G. Volan" Subject: Re: Task Discriminants & Arrays Date: 1997/05/13 Message-ID: <3378A5C5.5401@sprintmail.com>#1/1 X-Deja-AN: 241352611 References: <33787506.41C67EA6@spam.innocon.com> Reply-To: johnvolan@sprintmail.com Newsgroups: comp.lang.ada Date: 1997-05-13T00:00:00+00:00 List-Id: Jeff Carter wrote: > > As I understand it, task discriminants were intended to eliminate the > "serial bottleneck" that results from having to call an initialization > entry to provide information like this to task instances. However, as > far as I can tell, it simply complicates matters: You have to declare an > access type designating the task type, make your array type an array of > these access types, then allocate the tasks at runtime: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ No, not necessarily: > > task type T (Id : Positive) is > entry E; > end T; > > type T_Ptr is access all T; > > type A is array (Some_Range) of T_Ptr; > T_1 : aliased T (Id => 1); T_2 : aliased T (Id => 2); T_3 : aliased T (Id => 3); ... O : constant A := (1 => T_1'Access, 2 => T_2'Access, 3 => T_3'Access, ... ); ------------------------------------------------------------------------ Internet.Usenet.Put_Signature (Name => "John G. Volan", Home_Email => "johnvolan@sprintmail.com", Slogan => "Ada95: The World's *FIRST* International-Standard OOPL", Disclaimer => "These opinions were never defined, so using them " & "would be erroneous...or is that just nondeterministic now? :-) "); ------------------------------------------------------------------------