OpenMP (Open Multi-Processing) is the only library I know http://en.wikipedia.org/wiki/OpenMP - it does not, however, process things like this Python does by creating new processes. OpenMP is a compiler extension supported by Microsoft and the GNU GCC .
Example: OpenMP Lattice for Eratosthenes
// odd-only sieve int eratosthenesOdd(int lastNumber, bool useOpenMP) { // enable/disable OpenMP omp_set_num_threads(useOpenMP ? omp_get_num_procs() : 1); // instead of i*i <= lastNumber we write i <= lastNumberSquareRoot to help OpenMP const int lastNumberSqrt = (int)sqrt((double)lastNumber); int memorySize = (lastNumber-1)/2; // initialize char* isPrime = new char[memorySize+1];
source share