During commit process, the transaction grabs all write locks and then writes values together. I wonder if there is a possible deadlock during this process. For example, there are two Tvar var_A and var_B. transaction_1 grabs var A write lock an transaction_2 grabs var_B write lock. Then they both try to grab another write lock which causes a deadlock.
Hi, I am reviewing the source code and have a question.
https://github.com/Marthog/rust-stm/blob/91628b415ab401aa3d67f0c9e8a1f2e686ce1a6b/stm-core/src/transaction/mod.rs#L323-L333
During commit process, the transaction grabs all write locks and then writes values together. I wonder if there is a possible deadlock during this process. For example, there are two Tvar
var_A
andvar_B
.transaction_1
grabsvar A
write lock antransaction_2
grabsvar_B
write lock. Then they both try to grab another write lock which causes a deadlock.If I was wrong, feel free to correct me.