Original Post
So I'm working slowly through Structure and Interpretation of Computer Programs, but I've really hit a stumbling block on this concurrency section (section 3.4). Take, for example, exercise 3.42. I don't see any difference (logically, that is. I do see what code has been changed) between the code in the exercise and the code in the reading. Why would doing Bitdiddle's suggestion be wrong? I assume that it actually *is* wrong only because the reading would have correct code and Ben Bitdiddle has a history of incorrectness. Continuing from there: exercise 3.44. Am I correct here to say that no, there is no need for a more complicated function here? So long as the withdrawal and the deposit are successful, there is no room for further error. All actions on any bank account are completely serialized. 3.45: Okay, I have no clue why this is wrong, but I suspect that this misunderstanding goes back to the same thing as exercise 3.42. Well, while writing this I just had the idea that perhaps the problem in 3.42 would be deadlock caused by exchange acquiring the mutex and then trying to have withdraw and deposit acquiring the same mutex. But since that's not discussed until later, is that really the right answer? Thanks in advance!