Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
面对并发访问,ML 的 Ref 类型是否有任何访问保证?
我希望至少引用访问本身是原子的(例如,永远不要引用无效的内存位置:-)。但是,它取决于实现,因为线程不是 ML/SML 规范 afaik 的一部分。
“波动性”(跨线程/处理器对 ref 的读/写的一致视图)以及对底层对象的任何访问至少是需要考虑的另外两件事。再次,询问并发的实现。