]> AND Private Git Repository - loba.git/blobdiff - process.h
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Reintroduce process::get_sum_of_to_send().
[loba.git] / process.h
index ceca948a39433738d050b20f0864238d5203abf3..926bf1f9d064e343cd87273bdbdec41f41879cf9 100644 (file)
--- a/process.h
+++ b/process.h
@@ -21,6 +21,7 @@
 #include "msg_thread.h"
 #include "neighbor.h"
 #include "options.h"
 #include "msg_thread.h"
 #include "neighbor.h"
 #include "options.h"
+#include "synchro.h"
 
 class process {
 public:
 
 class process {
 public:
@@ -97,6 +98,9 @@ private:
     double real_load;           // current load
     double expected_load;       // expected load in bookkeeping mode
 
     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();
     // Load-balancing loop
     msg_thread* lb_thread;
     void load_balance_loop();
@@ -106,6 +110,9 @@ private:
 
     bool still_running();
 
 
     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);
     // Send procedures
     void ctrl_send(neighbor& nb);
     void data_send(neighbor& nb);