The Coir<Futures> library is our STL-based generic parallel programming library for shared-memory systems. It is built on top of a light-weight user-level thread library called Coir-Core [22] which supports standard thread operations for shared memory machines, and, in addition, includes support for locality, affinity, and migration domains.
Coir<Futures> recognizes control parallelism and data parallelism as two important models of parallelism. Control parallel abstractions provide a mechanism for specifying that one piece of computation can proceed in parallel with and independent of another piece of computation. Coir<Futures> supports control parallelism through future abstractions which are built on top of thread constructs. It supports thread classes and their inheritance mechanism. It has support for monitor-style programming and it separates thread-level operations from processor-level operations.
Data parallelism is a powerful and most commonly provided and used construct for parallelism, especially in scientific parallel computing. In a data parallel model, multiple processors/threads perform a common computation but each processor/thread operates on different data. In languages that have functions as first class data types, functional data parallelism can be defined by representing the common computation by a function or a function pointer. Traditionally data parallelism has been provided as a processor-level abstraction. The most common style is SPMD (Single Program Multiple Data) parallelism [6] where each processor executes the same program but based on the processor id each one executes it on a different section of the data. The program computation is interspersed with synchronization and data exchange. Coir<Futures> supports functional data parallelism at the thread level through the abstractions of thread groups called ropes [21]. Ropes are powerful data parallel objects which provide a scoping mechanism for non-blocking, multithreaded, and interleaved data parallelism, deviating from the popular but restricted SPMD-style data parallelism. Coir<Futures> has template facilities to customize these objects based on the function signatures.