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,36850f7846a01e8e X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: global rendezvou's Date: 1999/06/05 Message-ID: #1/1 X-Deja-AN: 485903371 References: <7hl0uh$omg$1@nnrp1.deja.com> NNTP-Posting-Date: Fri, 04 Jun 1999 19:56:30 PDT Newsgroups: comp.lang.ada Date: 1999-06-05T00:00:00+00:00 List-Id: kumkwat@my-dejanews.com writes: > I was wondering if it was possible to have a entry call in a task that > was not only defined in multiple tasks but because it is then I > wouldn't have to specify the name of the task first before calling the > entry. Basically I don't want to call the entry on a specific task but > just tell everyone that I want to pass an object to the first thread > that calls an accept. I've got a way via a protected object as a > buffer but was wondering if I could circumvent that and just do it this > way. If you want a broadcast feature, then you need to use a protected object to implement a signal. There are many examples of this in the ACM patterns archive; see the dining philosophers series of articles. > task temp1 is > entry hello; > end temp1; > > task temp2 is > entry hello; > end temp2; > > > -- somewhere in the main thread > hello; > > -- and not temp1.hello; or temp2.hello; You sound like you know this, but here it goes: protected Task_Initialization is procedure Start; entry Wait; private Started : Boolean := False; end; protected body Task_Initialization is procedure Start is begin Started := True; end; entry Wait when Started is begin null; end; end; task body Temp1 is begin Task_Initialization.Wait; ... end; task body Temp2 is begin Task_Initialization.Wait; ... end;