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.
の「else」部分は、別のトランザクションが読み取っorElseたトランザクションに書き込んでいるためにトランザクションが再試行されたときに呼び出されますか、それとも明示的に呼び出されたときにのみ呼び出されますか?TVarretry
orElse
TVar
retry
あなたが持っている場合
orElse ab
thenは で明示的に呼び出されたb場合にのみ実行されます。そうしないと、本質的に非決定論的になります。(STM ランタイムによって行われるトランザクションの再実行は透過的であり、計算の結果には影響しません。)retryaorElse
b
a