Final answer:
The project involves writing two independent programs, thr_atomic.c and thr_reduce.c, which perform calculations using multiple threads and synchronization mechanisms in C.
Step-by-step explanation:
The subject of this question is programming, specifically multi-threaded programming using the pthread library in C.
In the thr_atomic.c program, the main thread creates m threads using pthread_create() and each thread computes the sum of n/m quadruple roots. After finishing its computation, each thread prints its partial sum and atomically adds it to a shared global variable. Semaphore synchronization is used to let the main thread know when all the computational threads have completed their atomic additions.
The thr_reduce.c program is similar to thr_atomic.c, but it uses a parallel reduction approach. Instead of printing the partial sums, each thread stores its sum in an array element indexed by its thread ID. The reduction procedure is performed log(m) times, with each active thread adding two numbers together. Finally, there will be only one active thread that prints the whole array.