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,3e11ef4efc073f6b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!fdn.fr!freenix!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: requeue with abort and timed call Date: Tue, 30 Dec 2008 10:25:34 +0100 Organization: Adalog Message-ID: References: <2a60b044-6a5c-4ce6-93e6-6eeefc8806c3@l33g2000pri.googlegroups.com> <1f6rcb1qwt7vx.1mckzyk9ucohf.dlg@40tude.net> <84c56781-1cb1-4d86-be14-e66fc9fdade6@w1g2000prk.googlegroups.com> <7p8onuvzdz18$.1m1dq8n3b52q5.dlg@40tude.net> <9j9ajg.3a7.ln@hunter.axlog.fr> <2a0a1de3-6736-4478-9378-50b8895fa20d@r15g2000prh.googlegroups.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1230624313 16317 195.25.228.57 (30 Dec 2008 08:05:13 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Tue, 30 Dec 2008 08:05:13 +0000 (UTC) User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) In-Reply-To: <2a0a1de3-6736-4478-9378-50b8895fa20d@r15g2000prh.googlegroups.com> Xref: g2news1.google.com comp.lang.ada:3118 Date: 2008-12-30T10:25:34+01:00 List-Id: sjw a �crit : > The whole example is far from clear to me. If I were reviewing this > design I would have great difficulty understanding what the designer > was trying to do and whether the code achieved it. Sure, this is only an example to show an issue and demonstrate a problem. In real life, you wouldn't have seconds, but micro-seconds. Would be much more difficult to experiment with. > The decision to requeue ought to be speedy. Requeue because you can't > deal with it now; don't ponder for 3 seconds and then decide to > requeue for a further arbitrary period. Once again, the problem is not with the 3s. Could be much shorter. > > If the code said > > accept Original_Call do > Put_Line ("Original Call..."); > delay 3.0; > Put_Line ("Original Call Done"); > end Original_Call; > > ie without the requeue, the timed entry call would not be cancelled, > because we're abort-deferred. You are confusing things here, this has nothing to do with abort-deferral. Abort-deferral means that the called task cannot be aborted while engaged in a rendezvous. Timed entry call is about the caller being removed from the queue if the delay expires before the rendezvous has started. > So a caller design which relies on the > callee having/not having a requeue is broken. No. A timed entry call means: "if the server does not arrive within XX seconds, I give up". Requeue (with abort) allows the server to get the request, inspect the parameters, and decide that this request cannot be serviced now and put it back on wait. This is transparent as seen from the client's side. > Isn't it normally considered bad practice to do extensive processing > within the accept statement? Not within accept statements, but within protected subprograms or entries. Accept statements are of a much higher level of abstraction than POs. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr