Changes

Jump to: navigation, search

GPU621/Intel Parallel Studio Inspector.

No change in size, 23:38, 8 December 2021
no edit summary
Deadlocks can potentially happen when dealing with multi-threads. When 2 threads or more are stuck waiting for each other and trying to access the recourse but are being locked by the previous threads. In case of a deadlock, the program may run fine on the first try but the lock will eventually come up and crash the program. The following program will demonstrate deadlock occurring. The code involves resources protected by mutex locks. Their orders are m1->m2 or m2->m1. In some cases, 2 threads may cause a deadlock when they are waiting for a mutex owned by the other.
[[File:Deadlock_Code.jpg|950px600px]]
[[File:Deadlock_Output.jpg|950px]]
61
edits

Navigation menu