Loading Similar Posts
Tree Of Space Question extended part
Let's say you are running the lock/unlock in a multi-core machine. Now you want to let multiple threads run lock() simultaneously. As we saw in part I, locking a node has multiple validations inside. While doing lock on two nodes causes a race condition. If yes, how will you solve it? In short, how do make the lock() function thread safe?