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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c33f8f65997c21d0 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.105.2 with SMTP id gi2mr136207wib.4.1348660148571; Wed, 26 Sep 2012 04:49:08 -0700 (PDT) Path: q11ni63579953wiw.1!nntp.google.com!proxad.net!feeder1-2.proxad.net!news.mixmin.net!news2.arglkargh.de!noris.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 26 Sep 2012 13:49:09 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Problem with task component References: <1667b8e2qt7ei$.1gg1h3hrp9amz$.dlg@40tude.net> <187uk10m6z8xj.yr1cpbgrdur$.dlg@40tude.net> <1gq5enrpptnql.v7pdz1umht4a$.dlg@40tude.net> <19yadxsixu2y9$.1tfzkylgscckn$.dlg@40tude.net> <18te37e3kb1vq$.1bbagkhyd6aa1$.dlg@40tude.net> In-Reply-To: <18te37e3kb1vq$.1bbagkhyd6aa1$.dlg@40tude.net> Message-ID: <5062ebb3$0$6583$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 26 Sep 2012 13:49:07 CEST NNTP-Posting-Host: 8bd3eb41.newsspool3.arcor-online.net X-Trace: DXC=o_F5@`P;8LiOKO]LCQ@0g`McF=Q^Z^V3h4Fo<]lROoRa8kFfNfnc\616M64>jLh>_cHTX3jm6[[SN7APIkn X-Complaints-To: usenet-abuse@arcor.de Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2012-09-26T13:49:07+02:00 List-Id: On 26.09.12 09:27, Dmitry A. Kazakov wrote: > The weakness of this approach is that the client must know its master. It > is almost never the case. And it is tight coupling from the software design > POV. But from the software design POV, the client, or its programmer, always does know that there is an operational dependence if the client should react to the master's life cycle. I don't understand why this should not be made explicit? Also, arguably, a master knowing the clients will create tight coupling too, for it could otherwise be replaced with some other master. This could be considered better, more flexible software design. A registry to the rescue? (I notice that Ravenscar tasks require a different model entirely...) So why not create some measure of autonomy by type M is task Interface; type M_CRef is access constant M'Class; task body Server is Master_Task : M_CRef; begin accept Master (Master_Task : M_CRef) do Server.Master_Task := Master_Task; end Master; loop select accept ... do ... end; or delay Time_Out; exit when not Master_Task.all'Callable; end select; -- do something end loop; end Server; Server might even switch masters if the first acceptor is moved to the loop.