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.9 required=5.0 tests=BAYES_00,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b8705ab189212b9e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-06 13:46:05 PST Path: supernews.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news1.sttls1.wa.home.com.POSTED!not-for-mail From: "Mark Lundquist" Newsgroups: comp.lang.ada References: Subject: Re: (Newbie) intertask communication X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Message-ID: Date: Fri, 06 Apr 2001 20:46:04 GMT NNTP-Posting-Host: 24.20.66.55 X-Complaints-To: abuse@home.net X-Trace: news1.sttls1.wa.home.com 986589964 24.20.66.55 (Fri, 06 Apr 2001 13:46:04 PDT) NNTP-Posting-Date: Fri, 06 Apr 2001 13:46:04 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: supernews.google.com comp.lang.ada:6588 Date: 2001-04-06T20:46:04+00:00 List-Id: Pieter Thysebaert wrote in message news:q9nz6.15400$ii5.1263786@afrodite.telenet-ops.be... > Hi.... > > I'm trying to have two tasks interact (using entry/accept). > In fact we have this assignment where we are supposed to (not in reality) > monitor some patient's heartbeat. > > [example snipped...] OK, this post was a prime example of the right way to ask for help with a homework assignment! Thanks, Pieter! > How would I pass the "name" of a task to antoher task to have it use that > one ? > And how can I save a "reference"to a task ? Use an access type designating a task type. This can be used for any formal parameter (to a "callable entity", i.e. subprogram or entry, or to a generic), and of course you can declare a variable of this type in your Patient task and assign to it, to save your reference to the other task. So for example: task type Monitor is . . type Access_Monitor is access all Monitor; . . Monitor_1 : aliased Monitor; Patient_1.Start (Monitor_1'Access); Also, a task type can have discriminants. So you can do this: task type Patient (Associated_Monitor : Access_Monitor) For that matter, it can be an "access discriminant" (then you no longer need the access type, and you get a built-in null check): task type Patient (Associated_Monitor : access Monitor); Hope this helps, -- mark