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,e44790cdcea9da82 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit From: Brian May Newsgroups: comp.lang.ada Subject: Re: Problem with -gnatt References: <41651D37.4030805@mailinator.com> <2skt9qF1ljjdtU1@uni-berlin.de> <4165472D.2030704@mailinator.com> <416573FA.4010003@mailinator.com> <87k6u2mj08.fsf@insalien.org> <4166538E.6090907@mailinator.com> <41702af7$0$91003$39cecf19@news.twtelecom.net> <417377F7.7050506@mailinator.com> <4173f0ed$0$91003$39cecf19@news.twtelecom.net> <417409AB.8040702@mailinator.com> <4174BF2F.8050306@mailinator.com> <41752742$0$91006$39cecf19@news.twtelecom.net> <417536DE.3060405@mailinator.com> <41756ffe$0$91007$39cecf19@news.twtelecom.net> Date: Sat, 23 Oct 2004 16:28:35 +1000 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:8xTOMyoGFPMxG7smR8w7w/iz2L8= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: dsl-202-173-153-89.vic.westnet.com.au X-Trace: news.melbourne.pipenetworks.com 1098512901 202.173.153.89 (23 Oct 2004 16:28:21 +1000) X-Complaints-To: abuse@pipenetworks.com X-Abuse-Info: Please forward all headers to enable your complaint to be properly processed. Path: g2news1.google.com!news2.google.com!news.maxwell.syr.edu!news.mel.connect.com.au!news.netspace.net.au!news.melbourne.pipenetworks.com!not-for-mail Xref: g2news1.google.com comp.lang.ada:5654 Date: 2004-10-23T16:28:35+10:00 List-Id: >>>>> "Matthew" == Matthew Heaney writes: Matthew> That just pushes back the argument. If you can Matthew> "remember" to declare the data inside a protected object, Matthew> then surely you can "remember" to guard it with a Matthew> semaphore. Err?? If you put protected data inside a protected object, then you only have to remember once, when you create it. Once created, you cannot forget no matter how many times you may refer to it. If you use semaphores, then you have to remember to lock and unlock the semaphore every time you access a protected object. You also have to be careful if you gain two locks (either deliberately or accidently) at the same time not to cause deadlocks. Matthew> Who is "me"? The data in question is inside a package Matthew> body, and the only way to manipulate that data is to use Matthew> the operations provided by the package. So clearly a Matthew> client of the package cannot forget to "honor a lock," Matthew> since he sees neither the data nor the semaphore. True. If the package is simple enough, this might be OK. If the package is more complicated, I guess you could split it apart into a separate package that emulates a protected type. However, as I think I might have said before, I have read that creating a semaphore using a protected type is inefficient, because protected types where intended to be much more flexible then semaphores. -- Brian May