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,9d303864ae4c70ad X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-04-15 18:52:01 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: wojtek@power.com.pl (Wojtek Narczynski) Newsgroups: comp.lang.ada Subject: Re: Reprise: 'in out' parameters for functions Date: 15 Apr 2004 18:52:01 -0700 Organization: http://groups.google.com Message-ID: <5ad0dd8a.0404151752.4f598e1a@posting.google.com> References: <5ad0dd8a.0404090512.15af2908@posting.google.com> <5ad0dd8a.0404091828.6e79bb4e@posting.google.com> <8Oadneu6eY9pweDdRVn-hA@comcast.com> NNTP-Posting-Host: 83.27.43.192 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1082080321 4271 127.0.0.1 (16 Apr 2004 01:52:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 16 Apr 2004 01:52:01 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:7184 Date: 2004-04-15T18:52:01-07:00 List-Id: >> Or the simplest possible: two protected counters, try to get the >> sum atomically. > Since this is trivial, I can only assume that you have two protected > counters with no support for external locking in mind. I had in mind implementing it without the need to resort to abstraction inversion, which I understand as -for example- implementing semaphores over protected objects, which are implemented over semaphores. > Actually, you can even do that, by having one counter have a Sum operation > that calls the other. However, this whole subject is probably silly. Yes, this is silly because I oversimplifed the problem. The original problem I run into was how to implement a highly concurrent, space and time efficient list, tree, and finally lock manager. And before that, I wanted to grab a ready implementation of this (list, tree) from some library, but I could not find such a thing... > Reminds me of a lot of improvement requests for Ada 9X. "We want to do > such and such." > > "Well, here is a simple example of how to do it in current Ada." > > "Oh, but our software development plan doesn't allow us to use > Unchecked_Conversion." Yes, I should probably have dropped protected type in favor of raw semaphores. Regards, Wojtek