chiark / gitweb /
in multicore, generator periodically checks for new best to avoid generating many...
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 8 Mar 2014 19:42:59 +0000 (19:42 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 8 Mar 2014 19:42:59 +0000 (19:42 +0000)
main.c

diff --git a/main.c b/main.c
index 5eb9e19..6902365 100644 (file)
--- a/main.c
+++ b/main.c
@@ -202,6 +202,8 @@ static void mc_awaitpid(int wnum, pid_t pid) {
 }
 
 static void multicore_outer_iteration(int i, AdjWord min) {
+  static unsigned check_counter;
+
   assert(i == multicore_iteration_boundary);
   mc_iter_min = min;
   mc_rwvsetup_outer();
@@ -209,6 +211,9 @@ static void multicore_outer_iteration(int i, AdjWord min) {
   assert(r == mc_iovlen);
   /* effectively, this writev arranges to transfers control
    * to some worker's instance of iterate_recurse via mc_iterate_worker */
+
+  if (!(check_counter++ & 0xff))
+    multicore_check_for_new_best();
 }
 
 static void mc_iterate_worker(void) {