46
edits
Changes
→Deadlocks
#TBB (Thread Build Blocks)
#MPI (Message Passing Interface)
= Testing Intel Inspector =
You can find some online tutorials for [https://software.intel.com/en-us/articles/inspector-tutorials Intel Inspector here].
'''Levels of Analysis'''
#The first level of analysis has little overhead. Use it during development because it is fast.
#The second level (shown below) takes more time and detects more issues. It is often used before checking in a new feature.
#The third level is great for regression testing and finding bugs.
[[File:03-Choose-Level.png]]
== Memory Errors ==
=== Memory leaks ===
These are a resource leak leaks that occurs when a computer program incorrectly manages to release memory when it is no longer needed.
This may lead to extensive response times due to excessive paging, leading to slower applications.
===Mismatched allocation/deallocation===
this is when attempting to delete memory already deleted or allocate already allocated memory
[[File:Invalid_mem_access.JPG]]
===Race Conditions===
[[File:Race-Condition.png|800px]]
A deadlock is when a multiple processes attempt to access the same resource at the same time, and the waiting process is holding a resource that the first process needs to finish.
[[File:deadlockdeadlock_chart.png|400px]] '''Solutions''' #Create a global lock hierarchy#Use recursive synchronization objects such as recursive mutexes if a thread must acquire the same object more than once.#Avoid the case where two threads wait for each other to terminate. Instead, use a third thread to wait for both threads to terminate. '''Intel Inspector cannot detect a Deadlock problem involving more than four threads.''' [[File:dead_lock.png|800px]]
https://github.com/JTardif1/gpu_project/blob/master/Deadlock.cpp