[Openmcl-devel] are symbol property lists threadsafe?

Gary Byers gb at clozure.com
Mon Aug 5 10:11:21 PDT 2013


On Mon, 5 Aug 2013, Florian Dietz wrote:

> Is it safe to operate on property lists of symbols in a multithreaded 
> environment without using locks

No.

or can this result in wrong values or even 
> undefined behavior?

It's not hard to imagine that if two threads try to do

(setf (get x y) z)

at approximately the same time, the plist of x could contain multiple
entries for y in some cases.

It isn't hard to imagine that Bad Things would happen if two threads called
REMPROP on the same plist at about the same time.  I'm not sure that it's
easy to enumerate all of those Bad Things.

Symbol plist operations could be made (more) thread-safe if they were serialized
with a lock, but it's a little hard to imagine why multithreaded code would be
using symbol plists at all.  (For that matter, it's a little hard to imagine why
code written after ~1980 would be using symbol plists at all.)


> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list