guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: array handles and non-local exits


From: Andy Wingo
Subject: Re: array handles and non-local exits
Date: Thu, 09 Jul 2009 20:19:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

Hi,

On Mon 06 Jul 2009 21:30, address@hidden (Ludovic Courtès) writes:

> Andy Wingo <address@hidden> writes:
>
>> Good question. I suppose you have this case in mind:
>>
>>   (define s0 (string "foooooo"))
>>   (define s1 (substring/shared s0 0))
>>   (define s2 (substring/shared s1 0))
>>   (par-for-each (lambda (s) (string-set! s 0 #\b))
>>                 (list s0 s1 s2))
>
> Yes.  OTOH, the doc doesn't say that concurrent array accesses are safe,
> so array accesses are supposed to be synchronized at the application
> level, using mutexes, I suppose.

They should be safe in the sense that they shouldn't crash Guile, but
the result may be strange -- e.g. hashtable insertion.

> Still, I don't feel like we have any compelling reason to remove
> `scm_array_handle_release ()'.  One argument to keep it is that it's the
> kind of thing that's much easier to remove than to reinstate, and "we
> never know".  Also, removing it would cause gratuitous
> incompatibility.

To me this is a weak argument, especially given that much code probably
doesn't do the right thing in the presence of nonlocal exits.

Regarding compatibility, we could #define it to nothing if we compile
without DISABLE_DEPRECATED.

Cheers,

Andy
-- 
http://wingolog.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]