From 3b17939aa5e4bc3f63dea1f522a268efdd00f12e Mon Sep 17 00:00:00 2001 From: pm240836 Date: Mon, 20 Apr 2026 11:00:46 +0000 Subject: [PATCH] =?UTF-8?q?J'ai=20cr=C3=A9=C3=A9=20le=20fichier=20main,=20?= =?UTF-8?q?fonction=20des=20threads=20et=20include=20du=20header=20etc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 main.c diff --git a/main.c b/main.c new file mode 100644 index 0000000..8736da0 --- /dev/null +++ b/main.c @@ -0,0 +1,27 @@ +#include +#include +#include +#include +#include +#include // Pour mesurer le temps d'exécution +#include "puzzle.h" + +/* ================================================================= */ +/* FONCTION EXÉCUTÉE PAR CHAQUE THREAD */ +/* ================================================================= */ + +void* fonction_thread(void* arg) { + ThreadArgs* args = (ThreadArgs*)arg; + + int* solutions_locales = malloc(sizeof(int)); + *solutions_locales = 0; + + //Lancer la récursivité avec la pièce attribuée au thread au départ + placeAutoPiecerec(args->plateau_de_depart, args->catalogue, 0, solutions_locales, args->id_piece_depart); + + pthread_exit(solutions_locales); +} + +/* ================================================================= */ +/* PROGRAMME MAIN */ +/* ================================================================= */ -- GitLab