[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string-map arg order
From: |
Dirk Herrmann |
Subject: |
Re: string-map arg order |
Date: |
Mon, 3 Sep 2001 22:09:45 +0200 (MEST) |
On 30 Aug 2001, Alex Shinn wrote:
> After sleeping on it, I realized another disadvantage of utf16 is that
> string-set! and other mutators may have to resize the string, if
> you're converting from a two code char to a one code char, or vice
> versa. This probably means the string mutators have to be special
> forms which do a set! in these cases. The statistical probability of
> this is small enough that it isn't an efficiency concern, but it does
> cause problems with shared substrings (a mutator may or may not affect
> a shared substring).
With shared substrings you would have a copy-on-write semantics anyway.
That is, any string that is mutated needs to be copied if it shares memory
with other strings. This, btw., leads to a symmetry between a 'master'
and its shared substrings, each of which can also have shared substrings
of its own.
However, I fully agree with you about the problems of multiple-width
encodings: In case of multiple threads, every access to one of a string's
characters needs to recompute the memory location of that character,
because some other thread might have changed the string and even replaced
some characters of different encoding widths.
I have difficulties to believe that variable with encodings could
practically work in the context of multithreading at all.
Best regards,
Dirk Herrmann
- Re: string-map arg order,
Dirk Herrmann <=
- Re: string-map arg order, Alex Shinn, 2001/09/03
- Re: string-map arg order, Dirk Herrmann, 2001/09/03
- Re: string-map arg order, Alex Shinn, 2001/09/03
- Re: string-map arg order, Dirk Herrmann, 2001/09/04
- Re: string-map arg order, Alex Shinn, 2001/09/04
- Re: string-map arg order, Dirk Herrmann, 2001/09/05
- Re: string-map arg order, Alex Shinn, 2001/09/05
- Re: string-map arg order, Dirk Herrmann, 2001/09/06
- Re: string-map arg order, Alex Shinn, 2001/09/06
- Re: string-map arg order, Dirk Herrmann, 2001/09/06