tlds
Transactional Operations for Linked Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
worker.hpp
Go to the documentation of this file.
1 /**
2  * Copyright (C) 2011
3  * University of Rochester Department of Computer Science
4  * and
5  * Lehigh University Department of Computer Science and Engineering
6  *
7  * License: Modified BSD
8  * Please see the file LICENSE.RSTM for licensing information
9  */
10 
11 /* worker.hpp
12  *
13  * Main file for the parallel solver.
14  */
15 
16 #ifndef WORKER_HPP__
17 #define WORKER_HPP__
18 
19 #include "common.hpp"
20 #include "point.hpp"
21 #include "edge.hpp"
22 #include "queues.hpp"
23 #include "my_thread.hpp"
24 #include "barrier.hpp"
25 
26 // Everything regions (vertical stripes) need to know about each other.
27 //
28 struct region_info {
30  int *counts;
31  int npts;
35 
36  region_info(const int tid) {
38  points = new point*[num_workers];
39  counts = new int[num_workers];
40  npts = 0;
41  leftmost = rightmost = 0;
42  }
44  delete[] points;
45  delete[] counts;
46  }
47 };
48 
49 class worker : public runnable {
50  int col;
53 public:
54  virtual void operator()();
55  worker(int c, region_info **r, barrier *b)
56  : col(c), regions(r), bar(b) { }
57 };
58 
59 #endif // WORKER_HPP__
point * rightmost
Definition: worker.hpp:33
region_info ** regions
Definition: worker.hpp:51
region_info(const int tid)
Definition: worker.hpp:36
virtual void operator()()
Definition: worker.cpp:476
int * counts
Definition: worker.hpp:30
~region_info()
Definition: worker.hpp:43
Definition: barrier.hpp:28
Definition: point.hpp:33
int npts
Definition: worker.hpp:31
point ** points
Definition: worker.hpp:29
int col
Definition: worker.hpp:50
Definition: worker.hpp:49
point * leftmost
Definition: worker.hpp:32
simple_queue< edge * > * tentative_edges
Definition: worker.hpp:34
worker(int c, region_info **r, barrier *b)
Definition: worker.hpp:55
barrier * bar
Definition: worker.hpp:52
Definition: my_thread.hpp:33
Definition: queues.hpp:69
int num_workers
Definition: mesh.cpp:39
Definition: worker.hpp:28