tags:

views:

17

answers:

1

Are there any access guarantees with ML's Ref type in the face of concurrent access?

+2  A: 

I would hope that at least the ref access is atomic in itself (e.g. never have a ref to an invalid memory location :-). However, it'd depend on the implementation as threads are not part of the ML/SML spec afaik.

The 'volatility' (consistent view of the read/write to the ref across threads/processors), as well as any access to the underlying object are at least two other thing which need to be considered. Again, ask the implementation with concurrency.

pst