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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e3ad0eba55db3514 X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: task activation Date: 1999/11/22 Message-ID: <3839d353_2@news1.prserv.net>#1/1 X-Deja-AN: 551840075 Content-transfer-encoding: 7bit References: <383733d3_1@news1.prserv.net> Content-Type: text/plain; charset="US-ASCII" X-Complaints-To: abuse@prserv.net X-Trace: 22 Nov 1999 23:35:47 GMT, 129.37.213.102 Organization: Global Network Services - Remote Access Mail & News Services Mime-version: 1.0 Newsgroups: comp.lang.ada Date: 1999-11-22T00:00:00+00:00 List-Id: In article , Robert A Duff wrote: > Number 1 again. If you have a bunch of such packages, they will get > elaborated in some order that depends on with clauses and various > pragmas -- but when you elaborate the package body, the tasks therein > will be activated. OK. Thanks for this answer. Now another question. A few posts ago Robert Dewar made a comment about the problems you can have if you call a procedure as soon as the task has activated. For example: with P; package body Q is task O; task body O is begin P.Op; end; end Q; I think what Robert was saying was that you have no guarantee that the body of P has been elaborated yet. So if (activated) task O tries to call an operation provided by P, then you can get Program_Error. Is this analysis correct? What is the solution: 1) Elaborate(all) the packages you call, ie with P; pragma Elaborate_All (P); package body Q is task O; task body O is begin P.Op; end; end Q; Will this work OK? Or will it constrain the elaboration order unnecessarily? 2) No, don't elaborate the packages. Wait to be told (by the Ada main perhaps, which follows elaboration of all packages) that it's OK to start: with P; package body Q is protected Initialization is procedure Signal; entry Wait; private OK_To_Start : Boolean := False; end; ... task body O is begin Initialization.Wait; P.Op; end; end Q; What technique was intended by the language designers to address this issue? -- Get the FAQs about evolution and creationism.