Previous | Next --- Slide 12 of 62
Back to Lecture Thumbnails
pk267

The left picture is a deadlock because A is waiting for B's queue to have some space where it could place an item. But, B is waiting for A's queue to have some space so it could place an item in its queue. Thus, both are waiting and its a deadlock

cwchang

Another similar situation to this one was the one we discussed in the earlier class --- everyone tries to send messages simultaneously, while no one is able to receive the message. In such situation, everyone will be stuck at the sending stage. One way to resolve this situation is to let some of the workers send messages first and some of the workers receive messages first.

lya

@cwchang I think your description is a little bit inaccurate, in that separating worker into two categories is a way to avoid deadlock, rather than resolve it. Another approach to avoid deadlock in the queue example is to always leave an empty slot in the queue.