Access guarantees of ML Refs?
-
28-09-2019 - |
Question
Are there any access guarantees with ML's Ref type in the face of concurrent access?
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow