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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,97f543c7a63b8839 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!news.germany.com!news.belwue.de!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Composing tasks and protected objects Date: Fri, 05 Aug 2005 21:20:43 +0200 Message-ID: <87u0i4xkac.fsf@mid.deneb.enyo.de> References: <87iryk1eic.fsf@mid.deneb.enyo.de> <87oe8cz25n.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: albireo.enyo.de 1123269658 7542 212.9.189.177 (5 Aug 2005 19:20:58 GMT) X-Complaints-To: Cancel-Lock: sha1:xyd3tB9ywxkYC5yBLi+SKY0SGG8= Xref: g2news1.google.com comp.lang.ada:3990 Date: 2005-08-05T21:20:43+02:00 List-Id: * Robert A. Duff: > But the same conditions in the entry call case do not imply that the > called entry will never be triggered, because the called entry can be > essentially anywhere, without regard to scopes and whatnot. > >> In the queue example, you'd give up your subscription to that queue, >> but this would be handled by a controlled object declared in the task, >> I think. > > I don't understand what you mean here. As you wrote, you can't be sure that there won't be any further messages in the queue when the terminate alternative is selected. In general, you have to inform the sender about this, otherwise the queue will eventually get stuck. Therefore, in general, you need to notify the queue about the lack of receivers. Doing this with a controlled object seems to be a natural choice because it would also work in the presence of exceptions. (As always, there might be some nasty deadlock issues lurking somwhere. 8-)