"debut TD0"
This commit is contained in:
38
2019-2020/S3T_TP_07_THREADS/Demonstrations/pthread10.c
Normal file
38
2019-2020/S3T_TP_07_THREADS/Demonstrations/pthread10.c
Normal file
@@ -0,0 +1,38 @@
|
||||
///********************************************************************/
|
||||
///* IUT NICE-COTE D'AZUR - Departement INFORMATIQUE - R. CHIGNOLI */
|
||||
///* Module DUT M311 Theme PTHREADS */
|
||||
///********************************************************************/
|
||||
/// pthread10.c : squelette pour creation de trois threads
|
||||
/// Cf enonce ...
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
typedef struct { int nombre; char car;} struct_p;
|
||||
|
||||
void imprimer (struct_p* param){
|
||||
int i;
|
||||
for (i=0 ; i < param->nombre; i++) printf ("%c", param->car); }
|
||||
|
||||
int main (int argc, char* argv[]) {
|
||||
int i, valeur;
|
||||
struct_p x;
|
||||
char tab[3] = {'/', '*', '='};
|
||||
|
||||
assert (argc == 2);
|
||||
valeur = atoi (argv[1]);
|
||||
for (i=1; i<=3; i++) {
|
||||
printf ("\nMAIN : Tour de boucle nO %d\n", i);
|
||||
/// A VOUS DE JOUER
|
||||
/// Creation des trois threads d'affichage ...
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user