| 302 | // ---------------------------------------------------------------------------------------- |
| 303 | |
| 304 | bsp_context:: |
| 305 | bsp_context( |
| 306 | unsigned long node_id_, |
| 307 | impl1::map_id_to_con& cons_ |
| 308 | ) : |
| 309 | outstanding_messages(0), |
| 310 | num_waiting_nodes(0), |
| 311 | num_terminated_nodes(0), |
| 312 | current_epoch(1), |
| 313 | _cons(cons_), |
| 314 | _node_id(node_id_) |
| 315 | { |
| 316 | // spawn a bunch of read threads, one for each connection |
| 317 | _cons.reset(); |
| 318 | while (_cons.move_next()) |
| 319 | { |
| 320 | std::unique_ptr<thread_function> ptr(new thread_function(&impl2::read_thread, |
| 321 | _cons.element().value().get(), |
| 322 | _node_id, |
| 323 | _cons.element().key(), |
| 324 | ref(msg_buffer))); |
| 325 | threads.push_back(ptr); |
| 326 | } |
| 327 | |
| 328 | } |
| 329 | |
| 330 | // ---------------------------------------------------------------------------------------- |
| 331 | |