X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/6a266736a5a4f2e30a529662180050e8bc2b1a49..9f84b4517edbbcab8263c968b34b562573edb5b6:/process.h?ds=inline diff --git a/process.h b/process.h index dbf9b05..926bf1f 100644 --- a/process.h +++ b/process.h @@ -21,6 +21,7 @@ #include "msg_thread.h" #include "neighbor.h" #include "options.h" +#include "synchro.h" class process { public: @@ -97,15 +98,21 @@ private: double real_load; // current load double expected_load; // expected load in bookkeeping mode + mutex_t mutex; // synchronization between threads + condition_t cond; + // Load-balancing loop + msg_thread* lb_thread; void load_balance_loop(); // Simulate computation loop - msg_thread* compute_thread; void compute_loop(); bool still_running(); + // Returns the sum of "to_send" for all neighbors. + double get_sum_of_to_send() const; + // Send procedures void ctrl_send(neighbor& nb); void data_send(neighbor& nb);