Difference between revisions of "GPU621/CamelCaseTeam"

From CDOT Wiki
Jump to: navigation, search
(C++ Threading - explanation of C++ thread library)
Line 14: Line 14:
 
== C++ Threading ==
 
== C++ Threading ==
  
C++ threading consists of the creation of a thread that works on a function. By having multiple threads, multiple functions are able to be performed at the same time which enables parallel processing.  
+
C++ threading consists of the creation of a thread that works on a function. By having multiple threads, multiple functions are able to be performed at the same time which enables parallel processing.
 +
 
 +
<blockquote>
 +
<p>template<class Function, class... args></p>
 +
<p>explicit thread( Function&& f, Args&&... args);</p>
 +
</blockquote>
 +
 
 +
As seen above, a single thread takes a function through overloading and performs the task by passing the arguments to the function parameter which would execute separate to other threads. Once these threads are finished
 +
performing their function, the child thread must be joined using the .join() function in the thread library to the parent thread.
  
 
== OpenMP Threading ==
 
== OpenMP Threading ==

Revision as of 03:03, 22 July 2021


GPU621/DPS921 | Participants | Groups and Projects | Resources | Glossary

Project Name

C++11 Threads Library Comparison to OpenMP

Group Members

Andrei Fedchenko Hung Truong Ren Ren

Overview

Our team will do a research on comparison between c++ 11 threads library and openmp. We will code problems with both libraries to demonstrate the coding differences and do the performance analysis on those two approaches. We will highlight the techniques and best practices to achieve the best performance and avoid the pitfalls.

C++ Threading

C++ threading consists of the creation of a thread that works on a function. By having multiple threads, multiple functions are able to be performed at the same time which enables parallel processing.

template<class Function, class... args>

explicit thread( Function&& f, Args&&... args);

As seen above, a single thread takes a function through overloading and performs the task by passing the arguments to the function parameter which would execute separate to other threads. Once these threads are finished performing their function, the child thread must be joined using the .join() function in the thread library to the parent thread.

OpenMP Threading