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,5d05ccde5cefb836 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: Tasks and C/C++ code. Date: 1998/11/13 Message-ID: <364C63F4.CF423E54@elca-matrix.ch>#1/1 X-Deja-AN: 411502755 Content-Transfer-Encoding: 7bit References: <364702E5.F6987321@hiwaay.net> <729ndu$jfo$1@nnrp1.dejanews.com> <72b35b$pll$1@nnrp1.dejanews.com> <3649A4C4.4D3D22A2@hiwaay.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: ELCA Matrix SA Mime-Version: 1.0 Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1998-11-13T00:00:00+00:00 List-Id: "Barry L. Dorough" wrote: > > So, if I understand correctly defining the pragma to C in the declaration part of > the task body will give me multiple binding to the same function if there are > multiple tasks? Yes. There is only one copy of the C function anyway. Putting the pragma Interface/Import in a package, in a procedure, in a task, or in multiple places does not change this and has _exactly_ the same effect, except for the visibility of the function in your Ada code. > If this is correct what happens when you write an Ada procedure/function in a > task? Does each task get it own copy? I hope the answer is yes or I have > completely misunderstood the Ada tasking model! Yes, every instance of the task type gets its own copy, conceptually. But the code of the local procedure will exist only once in the object/executable file, and in memory, even if multiple calls are simultaneously active.