comp.lang.ada
 help / color / mirror / Atom feed
From: Craig Carey <research@ijs.co.nz>
Subject: Re: String library with garbage collection?
Date: Fri, 10 Jan 2003 13:14:42 +1300
Date: 2003-01-10T13:14:42+13:00	[thread overview]
Message-ID: <501s1voa23mlkfu93dailpb04dh20u7b0n@4ax.com> (raw)
In-Reply-To: VclT9.34987$p_6.2968515@bgtnsc04-news.ops.worldnet.att.net


On Thu, 09 Jan 2003 20:46:45 GMT, "James S. Rogers"
<jimmaureenrogers@worldnet.att.net> wrote:
>"Craig Carey" <research@ijs.co.nz> wrote in message
>news:u2ar1vcnuqia1j380gc3pk134rg87dgvba@4ax.com...
>> On Thu, 09 Jan 2003 11:33:56 +0100, Ingo "I. Marks"
><nospam_adv@region-nord.de>
>>  wrote:
>>
>> >I'm looking for an open source dynamic string library with garbage
>> >collection for Ada95.
...
>> I have a "faster than Unbounded Strings" strings package here:
>>
>>    http://www.ijs.co.nz/code/ada95_strings_pkg.zip
...
>Ada.Strings.Unbounded is not intended to be fast. It is intended
>to be dynamic. Ada strings are fast and inflexible. The package
>Ada.Strings.Unbounded allows you to instantiate fast and flexible
>strings.
>

That seems to be a seriously incomplete argument. Is there anything else
that a programmer might simply want that Ada's Unbounded Strings can't
deliver?. 

Since two major somewhat free implementations of Ada 95 have
Unbounded Strings that are noticeably slow, the intent may be something
that this message thread can fail to inquire into.

Also Unbounded Strings are not obviously "flexible" since there is no
true array slicing feature and also because of this...

If X:=Y is to be done, and Y is 500 MB big, and X has only got 10 KB
allocated for it, and also Y will never be used again, then it just can't
be done using swapping due to the inflexible design of the .. package and
the problem is that there is nothing in the package that is willing to
receive the information that variable Y won't be used again.

It is missing something, and if there was an AI to correct the problem
then based on some private e-mail I got, the AI might be voted against.


>The placement of variables in global scope can cause severe problems
>in a concurrent system. Be very careful when not to use global variables
>with tasks.


I meant global to each task. I did write that the globals were
parameters.  Anyway, the advice has to be ignored... since global
variables that do not change their value, and 'pragma Atomic()'
variables, can be safe to access. Also that strings package I mentioned
labels nodes in a simple global linked list, with Task_Id's which allows
safe erroneous simultaneous traversing and updating of the linked list,
which is faster than using protected objects. I tested the code and it
seems to run OK (and the definition of "erroneous" could be rechecked
at some future date).

RM 9.10 defines "erroneous":
   http://www.adaic.org/standards/95aarm/html/AA-9-10.html



Craig Carey





  reply	other threads:[~2003-01-10  0:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-09 10:33 String library with garbage collection? I. Marks
2003-01-09 19:50 ` Craig Carey
2003-01-09 20:41   ` Craig Carey
2003-01-09 20:46   ` James S. Rogers
2003-01-10  0:14     ` Craig Carey [this message]
2003-01-10  3:52       ` James S. Rogers
2003-01-10 11:35         ` Craig Carey
2003-01-09 20:09 ` Jeffrey Carter
  -- strict thread matches above, loose matches on Subject: below --
2003-01-09 11:04 Grein, Christoph
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox