Revision 83c5c285

View differences:

loop-mt.c
19 19

  
20 20
static void *chunk_forging(void *dummy)
21 21
{
22
  int chunk_period = period / chunks_per_period;
22
  int chunk_period = period;
23 23

  
24 24
  while(!done) {
25
    usleep(chunk_period);
26 25
    pthread_mutex_lock(&cb_mutex);
27 26
    generated_chunk();
28 27
    pthread_mutex_unlock(&cb_mutex);
28
    usleep(chunk_period);
29 29
  }
30 30

  
31 31
  return NULL;
......
91 91
  topParseData(NULL, 0);
92 92
  pthread_mutex_unlock(&topology_mutex);
93 93
  while(!done) {
94
    usleep(gossiping_period);
95 94
    pthread_mutex_lock(&topology_mutex);
96 95
    topParseData(NULL, 0);
97 96
    pthread_mutex_unlock(&topology_mutex);
97
    usleep(gossiping_period);
98 98
  }
99 99

  
100 100
  return NULL;
......
102 102

  
103 103
static void *chunk_sending(void *dummy)
104 104
{
105
  int chunk_period = period;
105
  int chunk_period = period / chunks_per_period;
106 106

  
107 107
  while(!done) {
108 108
    const struct nodeID **neighbours;
109 109
    int n;
110 110

  
111
    usleep(chunk_period);
112 111
    pthread_mutex_lock(&topology_mutex);
113 112
    neighbours = topGetNeighbourhood(&n);
114 113
    pthread_mutex_lock(&cb_mutex);
115 114
    send_chunk(neighbours, n);
116 115
    pthread_mutex_unlock(&cb_mutex);
117 116
    pthread_mutex_unlock(&topology_mutex);
117
    usleep(chunk_period);
118 118
  }
119 119

  
120 120
  return NULL;

Also available in: Unified diff