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-16 04:38:03 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: 16 Apr 2004 04:38:02 -0700 Organization: http://groups.google.com Message-ID: <5ad0dd8a.0404160338.5a1c9116@posting.google.com> References: <5ad0dd8a.0404090512.15af2908@posting.google.com> <5ad0dd8a.0404091828.6e79bb4e@posting.google.com> <8Oadneu6eY9pweDdRVn-hA@comcast.com> <5ad0dd8a.0404151752.4f598e1a@posting.google.com> NNTP-Posting-Host: 62.111.211.178 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1082115483 9489 127.0.0.1 (16 Apr 2004 11:38:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 16 Apr 2004 11:38:03 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:7202 Date: 2004-04-16T04:38:02-07:00 List-Id: Robert, First of all, thanks for writing me an essay. One day you might think of gathering all your c.l.a posts into a book. I would definitely buy a copy. But let me push it a bit more. > But there are two important points. First you _must_ as part of your > analysis of the problem domain identify the objects that need to be > managed. Analysis for generic data structures has been done decades ago. I'd prefer to use something readily available and not redo the analysis at this level. But let's grant that, as a result of throughout analysis, you conclude that you need a list that is sorted, space efficient, time efficient, updateable from many tasks at the same time. Any hint on how to implement this? > protected type List is > procedure Append(E: in Element); > procedure Prepend(E: in Element); > ... > function Is_Empty return Boolean; > function Length return Natural; > private > ... > end List; If you do this, only one task / thread will be able to update the data structure. > Should you expect to find a ready made implementation that meets your > needs? Possibly. But you almost certainly won't find it by looking for > libraries of protected objects. I found no examples of data structures with lock granularity lower than the whole data structure. Regards, Wojtek