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,1142654921f4156d X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: Two-Way Task Communication In Ada (w/o Protected Objects) Date: 1996/11/27 Message-ID: <329C60A4.E0E@gsfc.nasa.gov>#1/1 X-Deja-AN: 201051689 references: <19961125215900.QAA23391@ladder01.news.aol.com> content-type: text/plain; charset=us-ascii organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA mime-version: 1.0 reply-to: Stephen.Leake@gsfc.nasa.gov newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (Win95; U) Date: 1996-11-27T00:00:00+00:00 List-Id: 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