-- Aug 28 In-Class Exercise Thread
School example:
If we want to update the average scores of the whole class(process A), we are going to lock everyone's grade; at the same time, we want to compare the previous average scores with one of the student's scores(process B), than average scores will be lock at this time, we need to wait process A to release the student's grade to do the process B, but process A need process B to release average scores first, therefore, they are all waiting for each other to release the lock.
Airline reservation example:
Process A is to add a reservation to the list, therefore, it will lock the list and client's information. Process B is going to update the passport number of the client , therefore, it will lock the reservation list and client's information.
Process A is waiting for the reservation list release, and process B is waiting for the client's information release, they won't release until another process completes.
(
Edited: 2019-08-28)
School example:
If we want to update the average scores of the whole class(process A), we are going to lock everyone's grade; at the same time, we want to compare the previous average scores with one of the student's scores(process B), than average scores will be lock at this time, we need to wait process A to release the student's grade to do the process B, but process A need process B to release average scores first, therefore, they are all waiting for each other to release the lock.
Airline reservation example:
Process A is to add a reservation to the list, therefore, it will lock the list and client's information. Process B is going to update the passport number of the client , therefore, it will lock the reservation list and client's information.
Process A is waiting for the reservation list release, and process B is waiting for the client's information release, they won't release until another process completes.