-
Notifications
You must be signed in to change notification settings - Fork 110
review SWAP locks #1663
Comments
We haven't been able to reach a consensus on these issues. A meeting needs to be set up—including members of the incentives and core tracks—to end the discussion and settle on the implementation. |
We are going to move towards removing the getter/setter functions and the extra locks, based on the following comments made in PR #1554:
|
I'm temporarily suspending work on this one due to what's planned for #1604. |
This issue stems from a review for PR #1554. Original comment here.
Currently, the
Add
function applies the swaplock
for all of its code. In light of this, we should take a look at the following:Add
function?Lock()
calls withRLock()
calls? What about the reverse?Lock()
is called on theSwap.lock
variable, none of the code surrounded by lock calls from this variable can be accessed. These lines of codes might not actually be related to each other, i.e. they might deal with completely different resources, which don't need to have mutually exclusive access between themselves.Additionally, we are omitting a lock in the
getPeer
function based solely on the fact that theAdd
function calls in turn thegetPeer
function, and nested locks cause a deadlock.This is suspicious of bad design, so it should be reviewed as well.
The text was updated successfully, but these errors were encountered: