[plt-scheme] thread safety of structure field mutator procedures

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Mar 9 09:15:10 EST 2010

At Mon, 8 Mar 2010 23:38:47 -0500, "David T. Pierson" wrote:
> Section 10.1 of the reference manual [1] gives some information about
> the thread safety of things like set! and vector-set!
> 
> I would like to know whether similar guarantees can be given for
> structure field mutator procedures.
> 
> I am guessing that structure field mutator procedures are not
> necessarily atomic, but that they boil down to a vector-set! or
> something similar that is effectively atomic.

Yes, a field assignment is analogous to a `vector-set!'.

> Basically I am looking for assurance that it is ok to call the accessor
> procedure for a structure field while another thread may be calling the
> mutator procedure.

Yes.


Matthew



Posted on the users mailing list.