Changes

Jump to: navigation, search

GPU621/Group 6

1,077 bytes added, 10:51, 28 November 2018
Deadlocks
=== 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===
Race conditions are defined as a A race condition where occurs when multiple threads access the output same memory location without proper synchronization and at least one access is dependent on uncontrollable events sequence or timinga write.  There are multiple types of race conditions, such asa data race is a type of race condition that occurs #Data Race: Occurs when multiple threads attempt to perform an operation on shared data, a heap race that performs #Heap Race: Performs operations on a shared heap, or #Stack Race: Performs operations on a shared stack race. [[File:racecondition_chart.png|400px]] '''Solutions''' Privatize memory shared by multiple threads so each thread has its own copy.#For Microsoft Windows* threading, consider using TlsAlloc() and TlsFree() to allocate thread local storage.#For OpenMP* threading, which performs on consider declaring the variable in a private, firstprivate, or lastprivate clause, or making it threadprivate. Consider using thread stack memory.Synchronize access to the shared stackmemory using synchronization objects.#For Microsoft Windows* threading, consider using mutexes or critical sections.#For OpenMP* threading, consider using atomic or critical sections or OpenMP* locks
[[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
46
edits

Navigation menu