Are there any access guarantees with ML’s Ref type in the face of concurrent access?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.