comp.lang.ada
 help / color / mirror / Atom feed
From: Rex Reges <reges@mds.lmco.com>
Subject: Re: Reading a line of arbitrary length
Date: 1997/02/14
Date: 1997-02-14T00:00:00+00:00	[thread overview]
Message-ID: <3304BCFB.207B@mds.lmco.com> (raw)
In-Reply-To: dewar.855929857@merv


Robert Dewar wrote:

> If your point is that it is non-trivial to ensure efficient execution of
> programs that use variable length strings that are millions of characters
> long, then yes, that is true, it is non-trivial, and also non-important!
> 

What you say about very large variable length strings
is true. I did not clearly express what I was talking about:
one very long string and that string is of fixed length.

The case I was thinking of is a distributed real-time simulator.  It was
distributed in that it consisted of several Ada mains which may or may 
not run on the same CPUs within the same computer.  It was real-time
in that some of the processes had to repeatedly complete a specific 
amount of work within set frames of 120 Hz, 60Hz and 30Hz.  

The problem was how to pass string information quickly.  This 
string information consisted of error messages, symbol names, and 
commands.  The solution used was to create a string heap that 
was similar to the regular heap except that persistent strings
were compressed and that each process could add to its string heap 
from entries in another processes string heap.  

Integer IDs for strings were provided at string creation time and
were gauranteed to be unique among all the processes.  The code
which used the string heap was unaware of the compression and 
communication mechanisms.  This allowed strings to be passed 
around as if using access types, but provided global distributed
strings.

The large string issue arose in the string heap itself.
A single large fixed-length string was used as the heap.
Start index and size were used to keep track of each string
heap entry.  

It was possible to save the string heap to a file and then 
restore it later.  This was useful for the symbol table data
which doesn't change from one execution to another.  This
caused a problem on the Vax: not being able to read in a 
5 million character string in one chunk.  

I've left out a lot of details which are hopefully 
irrelevant to this discussion, but I would like to 
mention the compression needs.  The symbol information
consisted of 70,000 symbols which were fully qualified
Ada names.  It also included the enumeration values 
for those symbols which were enumeration types.  This
information alone was over 5 megabytes.  The compression
mechanism was simple: a vocabulary of frequently
occuring substrings was created, then each symbol was 
saved as an array of vocabulary entries.  

The constraints of the real-time response
precluded the usual fixes like storing strings in a file.
It was necessary to keep the memory usage to a minimum
so that the programs could be locked in memory to prevent
page swapping.
 
It's good news to hear about the pattern matching!  Up to
now I've been satisfied writing string tools as needed, but 
the general feeling I got from other Ada programmers is that 
Ada doesn't do strings.  


-- 
Rex Reges                      or you can call me The Fixer 
Systems Analyst                or you can call me The Lawyer
Lockheed Martin, M&DS          or you can call me The Doctor
(610)354-5047                  or you can call me Rexasaurus




  parent reply	other threads:[~1997-02-14  0:00 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-12  0:00 Reading a line of arbitrary length Thomas Koenig
1997-02-12  0:00 ` David C. Hoos, Sr.
1997-02-13  0:00   ` Jeff Carter
1997-02-13  0:00     ` Ted Dennison
1997-02-13  0:00       ` Geert Bosch
1997-02-13  0:00       ` Larry Kilgallen
1997-02-13  0:00       ` Rex Reges
1997-02-15  0:00         ` Matthew Heaney
1997-02-19  0:00     ` Jean-Etienne Doucet
1997-02-21  0:00       ` Mats Weber
1997-02-22  0:00         ` Robert Dewar
1997-02-24  0:00   ` Robert Dewar
1997-02-12  0:00 ` Robert Dewar
1997-02-13  0:00 ` Rex Reges
     [not found]   ` <dewar.855848896@merv>
     [not found]     ` <dsmith-1302971702290001@dsmith.clark.net>
1997-02-14  0:00       ` Mats Weber
     [not found]       ` <33047186.463F@mds.lmco.com>
1997-02-14  0:00         ` Robert Dewar
     [not found]     ` <33037A74.44AF@mds.lmco.com>
     [not found]       ` <dewar.855929857@merv>
1997-02-14  0:00         ` Rex Reges [this message]
1997-02-14  0:00         ` Gene Ouye
1997-02-15  0:00           ` Robert Dewar
1997-02-15  0:00             ` Brian Rogoff
1997-02-15  0:00               ` Robert Dewar
1997-02-16  0:00                 ` Brian Rogoff
1997-02-17  0:00                   ` Robert Dewar
1997-02-14  0:00       ` Mats Weber
1997-02-15  0:00         ` Robert Dewar
1997-02-17  0:00           ` Mats Weber
1997-02-17  0:00             ` Robert Dewar
1997-02-16  0:00   ` Jon S Anthony
1997-02-18  0:00     ` Robert Dewar
1997-02-22  0:00   ` Jon S Anthony
1997-02-21  0:00     ` Brian Rogoff
1997-02-22  0:00       ` Robert Dewar
1997-02-22  0:00         ` Brian Rogoff
1997-02-23  0:00     ` Robert Dewar
1997-02-25  0:00   ` Jon S Anthony
1997-02-26  0:00     ` Robert Dewar
1997-02-27  0:00   ` Jon S Anthony
1997-03-02  0:00     ` Robert Dewar
1997-03-02  0:00     ` Robert Dewar
1997-03-03  0:00       ` Fergus Henderson
1997-03-03  0:00         ` Larry Kilgallen
1997-03-04  0:00           ` Fergus Henderson
1997-03-05  0:00           ` Jon S Anthony
1997-03-03  0:00         ` Robert Dewar
1997-03-03  0:00   ` Jon S Anthony
1997-03-03  0:00   ` Jon S Anthony
1997-03-03  0:00   ` Jon S Anthony
1997-03-03  0:00     ` Robert Dewar
1997-03-04  0:00       ` Thomas Koenig
1997-03-05  0:00         ` Larry Kilgallen
1997-03-06  0:00           ` Robert Dewar
1997-03-06  0:00         ` Robert Dewar
     [not found]     ` <dewar.857447653@m <JSA.97Mar4154951@alexandria>
1997-03-05  0:00       ` Robert A Duff
1997-03-05  0:00     ` Jon S Anthony
1997-03-06  0:00       ` Robert A Duff
1997-03-06  0:00         ` Robert Dewar
1997-03-03  0:00   ` Jon S Anthony
1997-03-03  0:00     ` Robert Dewar
1997-03-04  0:00   ` Jon S Anthony
1997-03-05  0:00     ` Larry Kilgallen
1997-03-06  0:00       ` Fergus Henderson
1997-03-06  0:00         ` Really more GC talk (was: Reading a line of arbitrary length) Larry Kilgallen
1997-03-11  0:00           ` Fergus Henderson
1997-03-11  0:00             ` Robert Dewar
1997-03-12  0:00               ` Fergus Henderson
1997-03-04  0:00   ` Reading a line of arbitrary length Jon S Anthony
1997-03-05  0:00   ` Jon S Anthony
1997-02-16  0:00 ` Matthew Heaney
1997-02-16  0:00   ` Robert Dewar
1997-02-16  0:00     ` Matthew Heaney
1997-02-17  0:00       ` Robert Dewar
1997-02-25  0:00 ` Jon S Anthony
1997-03-04  0:00 ` Fergus Henderson
1997-03-05  0:00   ` Richard A. O'Keefe
1997-03-06  0:00     ` Fergus Henderson
1997-03-06  0:00       ` Robert Dewar
1997-03-11  0:00         ` Fergus Henderson
replies disabled

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