RE: Just say 'YES' to strings

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 3 Jun 2004, at 9:47, Al Getz wrote:

> 
> Hi there Kat,
> 
> I had a feeling someone was going to bring up Unicode strings smile
> Of course to handle that there would have to at least be a 
> second 'type' such as C_UCSTRING (in addition to C_STRING).
> 
> Not sure what you meant about the garbage collection though,
> maybe you could explain a little more? tia smile
 
Garbage collection is a operation where data stored in memory is rearranged 
to close up small holes of unused memory, so as to open up larger more 
usable holes. The more items pointing to a certian location, the more must 
be updated for each move. Just considering that more than one variable 
might point there take a little time. (That the other item may be a different 
type is immaterial tho, even if by some fluke the type is checked just 
because it's repointed during the gc.) If the gc is interrupted and 2nd item is 
accessed before it's updated, it most likely contains garbage. Threads or 
other processes that share var memory would barf on that problem. On the 
other paw, there's two time savings that can be realised: 1) when accessing 
the data, a single var can be looked up instead of stepping thru nested layers 
in the primary var,, 2) only one set of data needs moving in the actual gc. 
Keep in mind most languages give you no control of when the gc operation 
occurs, how much time is spent on it, if it is interruptable, what memory to 
relocate to (making it a sorta-combined-clean-up-and-move operation), or 
what vars to clean and which you know have not been accessed and to not 
clean. (Some gc copy every var at least once, and if you have 10,000 vars, 
call a func() that uses 50 of them intensely, why gc all 10,000 of them,,, just 
call gc at the end of that func(), thereby resetting the gc interval.... it can 
actually save time when used properly, in some situations, ymmv.) Anyhow, 
there's whole listservs devoted to garbage collection, ask David Cuny. smile

Kat

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu