You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am trying to use the STM system to run simultaneous transactions from multiple threads.
Unfortunately it seems either my usage is incorrect, or my understanding of the API is.
Can you please help me out ?
Code :
for _ in 1...3 {
Thread {
let _ =
transfer(from: alice, to: bob, amount: 100)
.then(transfer(from: bob, to: alice, amount: 20))
.then(deposit(into: bob, amount: 1000))
.then(transfer(from: bob, to: alice, amount: 500))
.atomically()
}.start()
}
Result :
If fails on this pre-condition
precondition(transactionEnterSucceed, "Transaction already running on current thread")
The text was updated successfully, but these errors were encountered:
Hi,
I am trying to use the STM system to run simultaneous transactions from multiple threads.
Unfortunately it seems either my usage is incorrect, or my understanding of the API is.
Can you please help me out ?
Code :
Result :
If fails on this pre-condition
The text was updated successfully, but these errors were encountered: