From: Ian Jackson Date: Sun, 9 Mar 2014 03:22:37 +0000 (+0000) Subject: multicore: in master, when collecting results, pay no attention to bus and look only... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=matchsticks-search.git;a=commitdiff_plain;h=c40dd9fe9a488a35d31dcf0083c4271660678f08 multicore: in master, when collecting results, pay no attention to bus and look only at our own best --- diff --git a/main.c b/main.c index 2cf9940..d290015 100644 --- a/main.c +++ b/main.c @@ -159,6 +159,7 @@ typedef struct { pid_t pid; } Worker; static Worker *mc_us; +static bool mc_am_generator; static void multicore_check_for_new_best(void); @@ -294,6 +295,7 @@ static void multicore(void) { genpid = fork(); assert(genpid >= 0); if (!genpid) { + mc_am_generator = 1; LPRINTF("generator running"); iterate(); exit(0); @@ -306,16 +308,18 @@ static void multicore(void) { for (w=0; ww); ssize_t wrote = write(mc_bus, &best, sizeof(best));