Giovanni Gigante wrote:
> Which of the following operations are thread-safe, i.e. in which of the
> following (if any) a thread can access a global variable without the
> need for a locking mechanism?
> a) aref
> b) aref 
> c) setf aref
> d) setf aref 
My guess is that all of those are thread-safe.
Don't take my word for it.
> e) gethash
> f) gethash 
> g) setf gethash
> h) setf gethash 
>From the documentation of MAKE-HASH-TABLE:
If NIL (the default), the hash-table may have multiple concurrent readers,
but results are undefined if a thread writes to the hash-table
concurrently with another reader or writer. If T, all concurrent accesses
are safe, but note that CLHS 3.6 (Traversal Rules and Side Effects)
remains in force. See also: SB-EXT:WITH-LOCKED-HASH-TABLE. This keyword
argument is experimental, and may change incompatibly or be removed in the
> also, svref instead of aref, if that makes any difference.