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,b59b337045eece60 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Structure of the multitasking server Date: Tue, 23 Sep 2008 12:47:34 +0200 Organization: Adalog Message-ID: References: <8b4d1170-22e6-40d3-8ed1-096dc0163491@m36g2000hse.googlegroups.com> <1w9y1ocmu2cm3$.724p6fohqdvy$.dlg@40tude.net> <259e95c5-92e6-4200-bc6e-5f35d99336a9@l64g2000hse.googlegroups.com> <11dyqk0lqb1je.ap31n7jjew7l.dlg@40tude.net> <1ey0wvc4tun7g$.15u4xyef05055$.dlg@40tude.net> <29fcd27f-aefd-4787-b8f6-5f8a04bd0f42@z72g2000hsb.googlegroups.com> <1njy6zbrm8yv0.fmtwebrb08bq$.dlg@40tude.net> <87ea7e07-1163-4fe5-8162-c5d46eed5bf7@m73g2000hsh.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 1222162409 10274 195.25.228.57 (23 Sep 2008 09:33:29 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Tue, 23 Sep 2008 09:33:29 +0000 (UTC) User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: <87ea7e07-1163-4fe5-8162-c5d46eed5bf7@m73g2000hsh.googlegroups.com> Xref: g2news2.google.com comp.lang.ada:7799 Date: 2008-09-23T12:47:34+02:00 List-Id: Maciej Sobczak a �crit : > This example uses rendezvous. > I don't like it, because it misuses exceptions for something that is a > perfectly normal control flow. > Yes, this is very subjective - for the record, I also don't like the > End_Error exception. > > BTW - the fact that you raise an exception only to shut it up in the > same scope indicates that this is a severe misuse of some language > feature. > This is a very restrictive (although widely shared) view of exceptions, where you consider that they are only for signaling failures. Exceptions are a programming tool for handling situations that are "exceptions" to the regular processing. This is the case for errors of course, but end of processing is perfectly appropriate. Moreover, using exceptions in this case has the benefit that the worker cannot ignore the signal (as would be the case with an out parameter). If the exception is not handled, the worker will crash, but not block the system. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr