Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis15/src/lib/parallel-target/scheduler.cxx
ViewVC logotype

Diff of /branches/vis15/src/lib/parallel-target/scheduler.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4636, Tue Sep 27 02:02:17 2016 UTC revision 4637, Tue Sep 27 02:11:43 2016 UTC
# Line 125  Line 125 
125      {      {
126          pthread_mutex_init (&this->_lock, nullptr);          pthread_mutex_init (&this->_lock, nullptr);
127          pthread_cond_init (&this->_runWait, nullptr);          pthread_cond_init (&this->_runWait, nullptr);
         pthread_cond_init (&this->_runWait, nullptr);  
128      }      }
129    
130      scheduler::~scheduler ()      scheduler::~scheduler ()
131      {      {
132          pthread_mutex_destroy (&this->_lock);          pthread_mutex_destroy (&this->_lock);
         pthread_cond_destroy (&this->_barrier);  
133          pthread_cond_destroy (&this->_runWait);          pthread_cond_destroy (&this->_runWait);
134      }      }
135    
136        void worker_main (void *data)
137        {
138            worker_info     *myInfo = static_cast<worker_info *>(data);
139            scheduler       *sched = myInfo->_sched;
140    
141            while (true) {
142                // wait on barrier
143              // check for termination
144                if (sched->_done) {
145                    return;
146                }
147              // run the task
148                sched->_task (myInfo);
149            }
150    
151        }
152    
153    
154  } // namepace diderot  } // namepace diderot

Legend:
Removed from v.4636  
changed lines
  Added in v.4637

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0