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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,af960bc705aaf51b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-04 08:44:30 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dennison@telepath.com (Ted Dennison) Newsgroups: comp.lang.ada Subject: Re: Complexity of protected objects Date: 4 Mar 2002 08:44:29 -0800 Organization: http://groups.google.com/ Message-ID: <4519e058.0203040844.3146c51b@posting.google.com> References: <4519e058.0202251401.27b95bb0@posting.google.com> <5ee5b646.0203021708.4812dbe7@posting.google.com> <3c833afb.435853953@News.CIS.DFN.DE> NNTP-Posting-Host: 65.115.221.98 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1015260270 11477 127.0.0.1 (4 Mar 2002 16:44:30 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 4 Mar 2002 16:44:30 GMT Xref: archiver1.google.com comp.lang.ada:20773 Date: 2002-03-04T16:44:30+00:00 List-Id: dmitry@elros.cbb-automation.de (Dmitry A. Kazakov) wrote in message news:<3c833afb.435853953@News.CIS.DFN.DE>... > On 2 Mar 2002 17:08:06 -0800, dewar@gnat.com (Robert Dewar) wrote: > > >dennison@telepath.com (Ted Dennison) wrote in message news:<4519e058.0202251401.27b95bb0@posting.google.com>... > >> I've generally found that to be good advice. In particular, my PO's > >> always seem to end up just being specialized semaphores or locks, no > >> matter how grandiose I start out planning to make them. Things just > >> work a lot better that way. > > > >This is MUCH too restrictive, it is perfectly reasonable > >to have a large complex data structure as a protected type > >where the operations on it ensure that consistency is > >maintained by doing related updates in a non-interruptible > >manner. > > Theoretically, yes. Practically, I have observed the same effect as > Ted Dennison pointed out. There are too many reasons why it does not > work, sigh. One of them is that protected types are not tagged. As a > result, very often one fails to use PO as the base for that large > complex data structore. Instead of that one has a PO with an access > discriminant pointing to some class wide. Slowly but steadily all the > functionality flows into that tagged type and in the end the PO > degrades to a simple lock. I usually end up with a slighly specialized lock or semaphore, but otherwise this is exactly right. Another prime mover in that direction is the effect that Dale pointed out elsewhere in this thread: "Another name for POs/semaphores are "bottlenecks". If you want to increase the natural parallelism of a program, you should make the code inside them as short as possible." Robert seems to read me as saying that this was a law enforced from above, but I never said that. Its a law in the same way Gravity is a law. :-) -- T.E.D. Home - mailto:dennison@telepath.com (Yahoo: Ted_Dennison) Homepage - http://www.telepath.com/dennison/Ted/TED.html