32 class CbcSpecificThread {
38 CbcSpecificThread(CbcSpecificThread *master, pthread_mutex_t *masterMutex);
40 virtual ~CbcSpecificThread();
43 void setUsefulStuff(CbcSpecificThread *master,
55 void lockThread2(
bool doAnyway =
false);
57 void unlockThread2(
bool doAnyway =
false);
61 void timedWait(
int time);
63 void startThread(
void *(*routine)(
void *),
CbcThread *thread);
71 void setStatus(
int value);
75 CbcSpecificThread *basePointer_;
77 pthread_mutex_t *masterMutex_;
78 pthread_mutex_t mutex2_;
79 pthread_cond_t condition2_;
80 Coin_pthread_t threadId_;
98 void setUsefulStuff(
CbcModel *model,
int deterministic,
113 inline bool isLocked()
const
121 bool wait(
int type,
int currentCode);
123 void waitNano(
int time);
127 void lockFromMaster();
129 void unlockFromMaster();
131 void lockFromThread();
133 void unlockFromThread();
141 inline int status()
const
143 return threadStuff_.status();
146 inline void setStatus(
int value)
148 threadStuff_.setStatus(value);
151 inline int returnCode()
const
156 inline void setReturnCode(
int value)
176 inline void setNode(
CbcNode *node)
181 inline CbcNode *createdNode()
const
186 inline void setCreatedNode(
CbcNode *node)
191 inline int dantzigState()
const
193 return dantzigState_;
196 inline void setDantzigState(
int value)
198 dantzigState_ = value;
201 inline double timeInThread()
const
203 return timeInThread_;
206 inline void incrementTimeInThread(
double value)
208 timeInThread_ += value;
211 inline double timeWaitingToStart()
const
213 return timeWaitingToStart_;
216 inline void incrementTimeWaitingToStart(
double value)
218 timeWaitingToStart_ += value;
221 inline double timeLocked()
const
226 inline void incrementTimeLocked(
double value)
228 timeLocked_ += value;
231 inline double timeWaitingToLock()
const
233 return timeWaitingToLock_;
236 inline void incrementTimeWaitingToLock(
double value)
238 timeWaitingToLock_ += value;
241 inline int deterministic()
const
243 return deterministic_;
246 inline int maxDeleteNode()
const
248 return maxDeleteNode_;
251 inline void setMaxDeleteNode(
int value)
253 maxDeleteNode_ = value;
256 inline int nDeleteNode()
const
261 inline void setNDeleteNode(
int value)
263 nDeleteNode_ = value;
266 inline void clearDelNode()
272 inline void fakeDelNode(
CbcNode **delNode)
277 inline CbcNode **delNode()
const
282 inline void setDelNode(
CbcNode **delNode)
287 inline int numberTimesLocked()
const
289 return numberTimesLocked_;
292 inline int numberTimesUnlocked()
const
294 return numberTimesUnlocked_;
297 inline int nodesThisTime()
const
299 return nodesThisTime_;
302 inline void setNodesThisTime(
int value)
304 nodesThisTime_ = value;
307 inline int iterationsThisTime()
const
309 return iterationsThisTime_;
312 inline void setIterationsThisTime(
int value)
314 iterationsThisTime_ = value;
317 inline int *saveStuff()
322 inline bool locked()
const
328 CbcSpecificThread threadStuff_;
336 double timeWaitingToLock_;
337 double timeWaitingToStart_;
338 double timeInThread_;
339 double timeWhenLocked_;
340 int numberTimesLocked_;
341 int numberTimesUnlocked_;
342 int numberTimesWaitingToStart_;
350 int iterationsThisTime_;
381 void stopThreads(
int type);
389 int waitForThreadsInTree(
int type);
395 void waitForThreadsInCuts(
int type, OsiCuts *eachCuts,
int whichGenerator);
398 void deterministicParallel();
403 inline void lockThread()
405 children_[numberThreads_].lockThread();
410 inline void unlockThread()
412 children_[numberThreads_].unlockThread();
416 inline bool isLocked()
const
418 return children_[numberThreads_].locked();
427 return threadModel_[i];
431 inline CbcThread *child(
int thread)
const
433 return children_ + thread;
437 inline int numberThreads()
const
439 return numberThreads_;
443 void setDantzigState();
457 OsiObject **saveObjects_;
459 int defaultParallelIterations_;
460 int defaultParallelNodes_;