comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: Two-Way Task Communication In Ada (w/o Protected Objects)
Date: 1996/11/27
Date: 1996-11-27T00:00:00+00:00	[thread overview]
Message-ID: <329C60A4.E0E@gsfc.nasa.gov> (raw)
In-Reply-To: 19961125215900.QAA23391@ladder01.news.aol.com


ericferg@aol.com wrote:
> 
> [snip]

> Would anyone happen to know of any way to position or structure Ada task
> declarations such that two tasks will have visibility of each other, and
> may _directly_ invoke each other's entries (and thus provide for direct,
> two way message & argument passing, without the use of intermediate
> argument buffers)?
> 

This compiles with gnat 3.04 :

procedure Example is

   task Don is
      entry One_Side;
   end Don;

   task Mclean is
      entry Another_Side;
   end Mclean;

   task body Don is
   begin
      accept One_Side
      do
         Mclean.Another_Side;
      end One_Side;

   end Don;

   task body Mclean is
   begin
      accept Another_Side;

      Don.One_Side;
   end;

begin

   Don.One_Side;
end Example;

Clearly this example does no real work :-). Perhaps you want the two
tasks to be in separate packages? Then the bodies can still reference
each other.

-- 
- Stephe




  reply	other threads:[~1996-11-27  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-25  0:00 Two-Way Task Communication In Ada (w/o Protected Objects) ericferg
1996-11-27  0:00 ` Stephen Leake [this message]
1996-11-27  0:00 ` Paul Chardon
  -- strict thread matches above, loose matches on Subject: below --
1996-11-27  0:00 W. Wesley Groleau (Wes)
replies disabled

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