[Openmcl-devel] Is setf atomic?

Pascal Costanza pc at p-cos.net
Tue Nov 6 12:47:27 PST 2007


So to get this straight - are you saying that even a setf on a simple  
variable, for example like (setf var 42) when var is not a symbol  
macro, is potentially not thread-safe?

Pascal

On 6 Nov 2007, at 18:42, Gary Byers wrote:

> If you're asking whether global variables and property lists are
> potentially shared resources just like everything else or whether
> they have some sort of magic dispensation ... well, there isn't
> any magic dispensation.
>
> There are certainly lots of low-level internal things in OpenMCL that
> do atomic read-modify-write operations that're guaranteed (by the
> hardware) to either succeed or detectably fail.  It's generally hard
> to map things like SETF (whose specified behavior is about as far from
> "atomic update" as one could imagine) onto these primitives, and it's
> not clear that that'd be desirable: such an atomic operation is likely
> to be an order of magnitude slower than a non-atomic operation in  
> terms
> of direct costs, and may have all kinds of indirect costs  
> (serialization
> on an machine that does out-of-order memory operations and/or  
> execution.)
>
>
> On Tue, 6 Nov 2007, Pascal Costanza wrote:
>
>> Hi,
>>
>> Are a setf on a simple variable, and a setf on a property list (i.e.,
>> a (setf getf)), thread-safe (atomic) operations in OpenMCL?
>>
>>
>> Thanks,
>> Pascal
>>
>> -- 
>> Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
>> Vrije Universiteit Brussel, Programming Technology Lab
>> Pleinlaan 2, B-1050 Brussel, Belgium
>>
>>
>>
>>
>> _______________________________________________
>> Openmcl-devel mailing list
>> Openmcl-devel at clozure.com
>> http://clozure.com/mailman/listinfo/openmcl-devel
>>
>>

-- 
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel, Programming Technology Lab
Pleinlaan 2, B-1050 Brussel, Belgium







More information about the Openmcl-devel mailing list