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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,6009c73a58f787a0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-14 00:35:03 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!195.25.12.36!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: How to avoid unreferenced objects (mutexes etc) Date: Mon, 14 Jan 2002 09:31:12 +0100 Organization: Adalog Message-ID: References: <3c3ee8c8.105408250@News.CIS.DFN.DE> NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 1010997216 3240 195.25.228.57 (14 Jan 2002 08:33:36 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Mon, 14 Jan 2002 08:33:36 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:18887 Date: 2002-01-14T09:31:12+01:00 List-Id: "Matthew Heaney" a �crit dans le message news: u41cg9jaqnrs56@corp.supernews.com... > > "Nick Roberts" wrote in message > news:a1o2h1$sfe3f$5@ID-25716.news.dfncis.de... > > However, really, a much better design is like this: > > No, because protected operations can't make blocking calls. > > Note that all predefined I/O packages are "potentially blocking," which > means, for example, that you can't call Text_IO from inside a protected > object. > > So you still need a semaphore-style type (as in the original post), to > handle the situation in which blocking calls are made inside a critical > section. The technique shown using a Limited_Controlled type to > automatically seize and release the semaphore is a standard Ada95 idiom. > Have a look at package Protection from Adalog's components page (http://www.adalog.fr/compo2.htm) for a component that automates this idiom. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr