From: Arnaud Giersch Date: Wed, 1 Jun 2011 15:01:33 +0000 (+0200) Subject: Be consistent, and start lb-loop by a receive too. X-Git-Tag: v0.1~57 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/1585b49c3b4c38379d8ebc955f0c86c8b3467aba?ds=sidebyside Be consistent, and start lb-loop by a receive too. --- diff --git a/NOTES b/NOTES index 19fafe8..71e2729 100644 --- a/NOTES +++ b/NOTES @@ -47,10 +47,10 @@ thread, and a load-balancing thread. --------------------- Loop + | receive ctrl messages | call load-balancing algorithm | send ctrl messages | sleep (min_lb_iter_duration) - | receive ctrl messages +- send CLOSE on ctrl for all neighbors wait for CLOSE on ctrl from all neighbors diff --git a/process.cpp b/process.cpp index 2de3016..47dd94a 100644 --- a/process.cpp +++ b/process.cpp @@ -127,6 +127,8 @@ void process::load_balance_loop() ++lb_iter; } + ctrl_receive(0.0); + mutex.acquire(); if (!opt::bookkeeping) expected_load = real_load - get_sum_of_to_send(); @@ -150,7 +152,6 @@ void process::load_balance_loop() mutex.release(); sleep_until_date(next_iter_after_date, opt::min_lb_iter_duration); - ctrl_receive(0.0); } XBT_VERB("Going to finalize for %s...", __func__);