guile-devel
[Top][All Lists]
Advanced

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

Re: thread safe functions


From: Ken Raeburn
Subject: Re: thread safe functions
Date: Tue, 15 Feb 2011 12:18:50 -0500

On Feb 10, 2011, at 17:19, Andy Wingo wrote:
>> procproc.c: There's a mutex to protect overrides, but it looks like
>> set-procedure-property! doesn't use it correctly; it should look more
>> like set-object-property! does.
> 
> I'm going to punt on this one, since it cannot access the hash table in
> an inconsistent state, and I don't care enough about what happens when
> multiple threads start changing the same procedure property (a fairly
> legacy interface) at once.  Furthermore there is always (assq-set!
> (procedure-properties foo) 'bar) to contend with...

It doesn't need to be the same property; I think different threads setting 
different new properties on a procedure in parallel may lose.  Both read the 
old property list, then each in turn acquires the lock and sets a new property 
list consisting of the new property added to the original list.  So the second 
one "wins", and the first update disappears.

Ken


reply via email to

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