2 ms·
I am having trouble reconciling the examples with the description of how B-threads work. Take the three-thread version of the 'water level' example: we start wi
by mannykannot 7y ago
I am having trouble reconciling the examples with the description of how B-threads work. Take the three-thread version of the 'water level' example: we start with the first two B-threads waiting on 'waterLevelLow', but the third thread is not waiting on anything, and presumably could advance to the point where it is waiting on 'addCold' - but it has blocked 'addCold' from occurring (a fact used later in the example), so if it did advance before 'waterLevelLow' occurred, it would become deadlocked. I think there must be more complexity here than is being explained.
- mannykannot 7y agoWhen I slowed down the animation, I saw what was happening: the third thread is waiting on 'addHot', and while (and only while) it is waiting, 'addCold' is blocked - so there is no deadlock here, but is deadlock ruled out in general? More generally, does the claimed ease of modification come at the cost of expanding the amount of reasoning about concurrency that you have to do?