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,1142654921f4156d X-Google-Attributes: gid103376,public From: Paul Chardon Subject: Re: Two-Way Task Communication In Ada (w/o Protected Objects) Date: 1996/11/27 Message-ID: <329BE98B.446B9B3D@avions.aerospatiale.fr>#1/1 X-Deja-AN: 200993036 references: <19961125215900.QAA23391@ladder01.news.aol.com> to: ericferg@aol.com content-type: text/plain; charset=us-ascii mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (X11; I; SunOS 4.1.3_U1 sun4m) Date: 1996-11-27T00:00:00+00:00 List-Id: ericferg@aol.com wrote: > > In a message dated 96-11-24 20:15:03 EST, blaak@mda.ca writes: > > << Two way communication with peers can be done by using a protected > object. Just > pretty it up with Send/Receive operations (make a Channel abstraction) > and have > the tasks work with a channel object to communicate. > >> > > Thanks for the info. Though I didn't mention it, I was actually trying to > AVOID intermediate protected objects between the tasks (which would act > as shared "dequeues" or "argument buffers" ... the "Channel abstraction" > you mention). > > 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)? > > If so, please post a reply or e-mail me at EricFerg@aol.com > > Thanks once again, blaak@mda.ca, for your response! > > Eric Ferguson A way to do that is offer by the structure of specification and body. You can then build such compilations units : ----------------------- Task A is entry entry_A; end A; ----------------------- Task B is entry entry_B; end B; ----------------------- with A; Task body B is begin ... A.entry_A; end B; ----------------------- with B; Task body A is begin ... B.entry_B; end A; ----------------------- I hope it is what you mean. If not, I've buid a data structure in Ada95 with a tagged type and a task in order to make visibility possible between two objects without to use the dependency between body and spec. Bye, Paul.