comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <Mats.Weber@elca-matrix.ch>
Subject: Re: Tasks and C/C++ code.
Date: 1998/11/13
Date: 1998-11-13T00:00:00+00:00	[thread overview]
Message-ID: <364C63F4.CF423E54@elca-matrix.ch> (raw)
In-Reply-To: 3649A4C4.4D3D22A2@hiwaay.net

"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.




  parent reply	other threads:[~1998-11-13  0:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-09  0:00 Tasks and C/C++ code Barry L. Dorough
1998-11-09  0:00 ` Mats Weber
1998-11-10  0:00 ` dennison
1998-11-11  0:00   ` dbotton
1998-11-11  0:00     ` dennison
1998-11-11  0:00     ` Barry L. Dorough
1998-11-11  0:00       ` dennison
1998-11-12  0:00       ` Jerry van Dijk
1998-11-13  0:00       ` Mats Weber [this message]
1998-11-18  0:00     ` Samuel Tardieu
1998-11-19  0:00       ` Mats Weber
1998-11-20  0:00         ` Samuel Tardieu
1998-11-23  0:00           ` Mats Weber
1998-11-23  0:00             ` Tom Moran
1998-11-24  0:00               ` Blocking protected ops (was: Tasks and C/C++ code) Mats Weber
1998-11-24  0:00                 ` Robert I. Eachus
1998-11-25  0:00                   ` Mats Weber
1998-11-25  0:00                     ` Robert I. Eachus
1998-11-26  0:00                       ` Simon Wright
1998-11-27  0:00                         ` David Botton
1998-11-27  0:00                           ` Tom Moran
1998-11-27  0:00                             ` Jerry van Dijk
1998-11-28  0:00                               ` Tom Moran
1998-11-27  0:00                           ` Mats Weber
1998-11-29  0:00                         ` Tucker Taft
1998-11-30  0:00                           ` Simon Wright
1998-11-25  0:00                     ` Jean-Pierre Rosen
1998-11-27  0:00                       ` Mats Weber
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox