Open main menu

CDOT Wiki β

Changes

GPU621/Intel Parallel Studio Inspector.

10 bytes removed, 09:06, 9 December 2021
no edit summary
This maximizes the scope of the threading analysis. Using this setting will also maximize the time, resources, and load on the system to perform the analysis. This will detect an extensive range of threading issues including deadlocks and data races. Intel Inspector will display the context of the problem and the highest degree of information available.
==='''Race Condition'''=Conditions ==
Intel Inspector can be used to detect race conditions in programs. The following code is an example of race conditions occurring. In it, 5 threads are created to increment the value of an object several times. A race condition occurs when the threads race for the same data, therefore the value will be inconsistent and output different results. Normally in a data race, it becomes hard to locate data manually but with the help of Intel Inspector, it is much faster.
''Indicating where the data race occurs''
==='''Deadlock'''=Deadlocks ==
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.
61
edits