#include #include #include #include typedef struct duel{ int participant1; int participant2; } duel; void *tournois(void *thread_id) { int id = *((int *) thread_id); printf("Hello from thread %d\n", id); return NULL; } int puissance2(int n){ for (int p=1; pnom = argv[i]; participant->id = i; } while (nbDuel > 1){ for (int i = 0; i < nbDuel; i++){ duel[nbDuel] tabDuel; participant participant2; for (int x=0, y=0, ) participant duel[] = {participant[i], participant[i+1]}; assert( pthread_create(&threads[i], NULL, tournois, &participant[i]) == 0); } for (int i = 0; i < NUM_THREADS; i++){ assert( pthread_join(threads[i], NULL) == 0); } nbParticipant /= 2; nbDuel /= 2; } return EXIT_SUCCESS; }