Homework-7 Version 0 |
|
👤 Author: by 1224532347qqcom 2020-11-10 07:40:55 |
For deadlocks to occur, four conditions must be met: (1) the mutex condition: a resource can only be used by one process at a time. (2) Request and hold condition: When a process is blocked by requesting a resource, it will hold on to the acquired resource. (3) Condition of not depriving: The resources obtained by the process cannot be deprived before the end of use. (4) Cyclic wait condition: A kind of cyclic wait resource relationship is formed between several processes which are connected head to tail. These four conditions are necessary for a deadlock, and they must be true whenever a deadlock occurs in the system.
I have encountered such process deadlocks myself: for example, in normal games, when the command to cancel the process is issued in the loading interface, a process deadlock will occur. The load and cancel commands will act on the same object, causing one resource to be used by two processes.
Solution: Start the process manager to stop one of the processes, and the deadlock will soon disappear.