A Review of CUDA, MapReduce, and Pthreads Parallel Computing Models <s> PTHREADS <s> Recently, there has been an effort to specify an IEEE standard for portable operating systems for open systems, called POSIX. One part of it, the POSIX 1003.4a threads extension (Pthreads for short) [12], describes the interface for light-weight threads that rely on shared memory and have a smaller context frame than processes. This paper describes and evaluates the design and implementation of a library of Pthreads calls that is solely based on UNIX. It shows that a library implementation is feasible and can result in good performance. This work can also be used as a comparison of the performance of other implementations, or as a prototyping, testing, and debugging system in the regular UNIX environment. Finally, some problems with the Pthreads standard are identified. <s> BIB001 </s> A Review of CUDA, MapReduce, and Pthreads Parallel Computing Models <s> PTHREADS <s> The development of microprocessors design has been shifting to multi-core architectures. Therefore, it is expected that parallelism will play a significant role in future generations of applications. Throughout the years, there has been a myriad number of parallel programming models proposed. In choosing a parallel programming model, not only the performance aspect is important, but also qualitative the aspect of how well parallelism is abstracted to developers. A model with a well abstraction of parallelism leads to a higher application-development productivity. In this paper, we propose seven criteria to qualitatively evaluate parallel programming models. Our focus is on how parallelism is abstracted and presented to application developers. As a case study, we use these criteria to investigate six well-known parallel programming models in the HPC community. <s> BIB002
The first POSIX (portable operating system interface) threads model was created by the IEEE computer society in 1988 and current versions are maintained by the Austin common standards revision group   . One very popular application programming interface (API) for multi-threading, is Pthreads, also known as POSIX threads, with the IEEE and ISO notation of P1003.1c and ISO/IEC 9945-1:1990c respectively   . Pthreads programming model is part of the C programming language and composed of programming types and procedure calls, that get called and included by a pthread.h header thread library; however, the pthread.h header library might be part of another library in other Pthreads implementations  [27]  . Pthreads do not depend on data transfer but utilize the cache to CPU and memory to CPU bandwidth for data transfer, thus making Pthreads process computations much faster  . To fully exploit the computational potential presented by Pthreads, a program has to be structured into distinct autonomous processes which then get implemented and run in parallel on a high performance machine  . An example would include sub-routine1 and sub-routine 2 being swapped, enclosed, and overlaid in real time, thus making them suitable for multithreading  . Pthreads are composed of about 100 Pthreads subroutines, which begin with a "pthread_" preface and are largely classified as follows  [27] BIB001 : (i) Thread management sub-routines: these are subroutines that affect threads directly, for example creating, detaching, and joining. (ii) Mutexes subroutines: these are sub-routines that handle synchronization in threads, by using mutual exclusion (mutex) to enforce determinism by harmonization in threads. (iii) Condition variable sub-routines: these are sub-routines that handle communication between threads that have a common mutex in enforcing synchronization. (iv) Synchronization sub-routines: these are sub-routines that enforce determinism in threads by managing read and write locks, and barriers. One of the drawbacks of Pthreads is how to manage the persistent problem of non-determinism  . POSIX threads depend on thread mutexes, condition variables, and synchronization control methods in managing determinism in threads; with mutexes only permitting one thread to enter a critical section at a time and avoiding deadlocks BIB002 . The following are some of the most utilized Pthreads prefixed sub-routines  Generating and discarding threads: Pthreads is composed of two main functions responsible for creating and terminating threads, namely, pthread_create and pthread_exit  [1]  . The pthread_create function constrains a programmer to stipulate the thread used to run tasks, the attribute, tasks to be run by thread in a routine call, and the routine argument  BIB002 . The pthread_exit function permits the programmer to stipulate how and when a thread gets discarded, by either returning normally from its subroutine when its work is done, or having the thread terminated by another thread  [27] [1].