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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3ccb707f4c91a5f2 X-Google-Attributes: gid103376,public From: "Norman H. Cohen" Subject: Re: Unbounded strings (Was: Java vs Ada 95 (Was Re: Once again, Ada absent from DoD SBIR solicitation)) Date: 1996/11/25 Message-ID: <3299FD97.6A0B@watson.ibm.com>#1/1 X-Deja-AN: 200692096 references: <325BC3B3.41C6@hso.link.com> content-type: text/plain; charset=us-ascii organization: IBM Thomas J. Watson Research Center mime-version: 1.0 reply-to: ncohen@watson.ibm.com newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (Win95; I) Date: 1996-11-25T00:00:00+00:00 List-Id: Robert Dewar wrote: > Friendly readings are fine, but I do not know what is friendly and what > is not. > > Let's look at the reference count case. I see two friendly readings here: > > 1. An efficient implementation with reference counts is permitted, no > locks are needed, since if two tasks mess with the same sets of > variables or values, the execution is erroneous. > > 2. If reference counts are used, task locks are required, requiring > a kernel call on some systems, and therefore, becuase of the > quite unacceptable efficiency effect, reference counts are out > of the question. > > Which of these is friendlier? Well if you don't use tasking, or if you > use only completely separated sets of values and variables in the > tasking case, you find 1 much friendlier, since a reference count > implementation makes a lot of sense in these cases. > > If you insist on using unbounded strings across tasks, thinking that > the assignment semantics are like ordinary scalar types, then of course > you might find 1 friendlier. What I would find friendliest is a run-time system with two versions of Ada.Strings.Unbounded. The version that uses reference counts but no locks would only be linked in when I said pragma Restrictions (Max_Tasks => 1); Otherwise, I would get the task-safe version (presumably without reference counts, since the cost of locking would most likely outweigh any savings from lazy copying). -- Norman H. Cohen mailto:ncohen@watson.ibm.com http://www.research.ibm.com/people/n/ncohen