URL: https://linuxfr.org/forums/programmation-c--2/posts/passer-des-arg-ds-un-tableau-au-pthreads Title: Passer des arg ds un tableau au pthreads Authors: monalisa16 Date: 2012年06月04日T19:24:00+02:00 Tags: Score: -5 Salut,, J'ai un petit sousciii svpp je creer un tableau en C je le remplis Et je met une boucle pr creer +sieurs pthreads ,,tel que chaque thread prends en argument un element de la table mais il ne me creer des threads qu'avc un seul element de la table comme ceci ====> ////////////////////////creation de la table tableau[k] = devname; k++; pthread_t thread[7]; for (k= 0; k< 7; k++) { rc = pthread_create(&thread[k],NULL,&threadsniffer,(void *)tableau[k]); //k++; if (rc !=0) { printf("pthread_create error for thread \n"); exit(0); } else {count++;} pthread_join( thread[k], NULL); } } Merrrrciiii de me reponnndreee mercii :)

AltStyle によって変換されたページ (->オリジナル) /