Parallelization is the execution of the program in multiple CPUs. This is done mainly to improve the performance of a given program. In parallel computing, memory can be shared or distributed. Here, we will only be concerned with shared memory where all cores can read and write the same memory location. We will examine two problems, thread addition and parallel factorial functions, and we will propose a suggested solution for both problems.
- ThreadSum.java makes 1,000 threads each of them adds one to a variable called sum.
- Factorial.c compute the factorial for some integer n in parallel.
- project/OpenMP has the implementation of the quicksort algorithm in OpenMP.