Name: Anonymous 2011-12-18 15:51
So /prog/, what do you think about current situation of concurrent programming?
Isn't it shit and pain in the ass?
Isn't it shit and pain in the ass?
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
int main(int argc, char **argv) {
int i;
omp_set_num_threads(argc-1);
#pragma omp parallel for
for (i = 0; i < argc - 1; i++) {
long int this = atol(argv[i+1]);
sleep(this);
printf("%ld\n", this);
fflush(stdout);
}
return 0;
}