/* * Procedure Main du fichier source */ int main() { GeneratePrimes(); GenerateDifferences(); //int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg); //int pthread_join(pthread_t thread, void **retval); //int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr); //freopen("test.in","r",stdin); pthread_t t1,t2,t3,t4; //freopen("test.out","w",stdout); input = fopen("race.txt","r"); pthread_mutex_init(&mutexLecture,NULL); pthread_mutex_init(&mutexAffichage,NULL); pthread_create(&t1,NULL,(void*) Compute_Simul_t1,NULL); pthread_create(&t2,NULL,(void*) Compute_Simul_t2,NULL); pthread_create(&t3,NULL,(void*) Compute_Simul_t3,NULL); pthread_create(&t4,NULL,(void*) Compute_Simul_t4,NULL); pthread_join(t1, NULL); pthread_join(t2, NULL); pthread_join(t3, NULL); pthread_join(t4, NULL); pthread_mutex_destroy(&mutexLecture); pthread_mutex_destroy(&mutexAffichage); return 0; }
int main(void) { std::vector<int> primes = GeneratePrimes(18); for (int prime: primes) { std::cout << prime << std::endl; } return 0; }
int main() { GeneratePrimes("primes"); }
int main() { GeneratePrimes(UPPER_BOUND); return 0; }