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,13c68a067434682,start X-Google-Attributes: gid103376,public From: Larry Coon Subject: Task question Date: 1997/10/06 Message-ID: <3439D647.7C43@home.com>#1/1 X-Deja-AN: 279001813 Organization: @Home Network Reply-To: lmcoon@home.com Newsgroups: comp.lang.ada Date: 1997-10-06T00:00:00+00:00 List-Id: I'm having a problem getting a task body to work the way I want it to. Here's a contrived example showing (with illegal syntax) what I want to do: task body x is begin loop select accept my_rendezvous (some_data: some_data_type) do -- Rendezvous stuff end my_rendezvous; or exit; -- This is illegal end select; end loop; -- Now do more stuff. end x; The idea is that this task serves as a collector. Another task continually initiates rendezvous (what is plural for rendezvous?), with this task, and this tasks collects the information that is sent. When the "calling" task is done it terminates. Since the select statement is smart, it knows it can't be called any more and invokes the exit, which terminates the loop so the rest of the task body executes, and it does more stuff. That's how I want it to work, anyway. If I do: or terminate; in place of the exit then it knows when the "calling" task is done and will terminate the task, but this isn't what I want -- the "other stuff" never gets executed. I've also tried adding another accept as a signal for when the "calling" task is done: task body x is begin loop select accept my_rendezvous (some_data: some_data_type) do -- Rendezvous stuff end my_rendezvous; or accept done do exit; end done; end select; end loop; -- Now do more stuff. end x; Now the "calling" task keeps initiating a my_rendezvous, but when it's finished it inititates a done to let this task know it can proceed. This doesn't work either -- it doesn't let an exit transfer control out of the accept statement. Am I missing an obvious way to do what I want? Larry Coon University of California larry@fs2.assist.uci.edu and lmcoom@home.com