Open main menu

CDOT Wiki β

Changes

GPU621/CamelCaseTeam

690 bytes added, 20:07, 28 July 2021
Usage of C++11 Threading - Adding explanation of example
C11 Thread - Counting to: 100000000 - Number of threads created: 16 | elapsed time: 223 ms
</syntaxhighlight>
 
The above code shows a simple demonstration on the performance of using C11 Thread library where it counts the number of iteration in a large amount. The thread library requires another library to produce a critical section in the form of mutex which allows for signals the section of the code that is under critical so that the thread must run and finish its task before rejoining with the other threads. This is similar to the OpenMP's #pragma omp critical directive but OpenMP does not require an additional library to perform this function. Taking the average of 10 runs for each number of threads, there is a slight increase in performance as the number of threads increases as well.
== OpenMP Threading ==
16
edits