33 class CbcSpecificThread {
39 CbcSpecificThread (CbcSpecificThread * master, pthread_mutex_t * masterMutex);
41 virtual ~CbcSpecificThread();
44 void setUsefulStuff (CbcSpecificThread * master,
56 void lockThread2(
bool doAnyway =
false);
58 void unlockThread2(
bool doAnyway =
false);
62 void timedWait(
int time);
64 void startThread(
void * (*routine ) (
void *),
CbcThread * thread);
72 void setStatus(
int value);
77 CbcSpecificThread * basePointer_;
79 pthread_mutex_t *masterMutex_;
80 pthread_mutex_t mutex2_;
81 pthread_cond_t condition2_;
82 Coin_pthread_t threadId_;
101 void setUsefulStuff (
CbcModel * model,
int deterministic,
104 void *& masterMutex);
116 inline bool isLocked()
const {
123 bool wait(
int type,
int currentCode);
125 void waitNano(
int time);
129 void lockFromMaster();
131 void unlockFromMaster();
133 void lockFromThread();
135 void unlockFromThread();
143 inline int status()
const {
144 return threadStuff_.status();
147 inline void setStatus(
int value) {
148 threadStuff_.setStatus( value);
151 inline int returnCode()
const {
155 inline void setReturnCode(
int value) {
159 inline CbcModel * baseModel()
const {
163 inline CbcModel * thisModel()
const {
167 inline CbcNode * node()
const {
171 inline void setNode(
CbcNode * node) {
175 inline CbcNode * createdNode()
const {
179 inline void setCreatedNode(
CbcNode * node) {
183 inline int dantzigState()
const {
184 return dantzigState_;
187 inline void setDantzigState(
int value) {
188 dantzigState_ = value;
191 inline double timeInThread()
const {
192 return timeInThread_;
195 inline void incrementTimeInThread(
double value) {
196 timeInThread_ += value;
199 inline double timeWaitingToStart()
const {
200 return timeWaitingToStart_;
203 inline void incrementTimeWaitingToStart(
double value) {
204 timeWaitingToStart_ += value;
207 inline double timeLocked()
const {
211 inline void incrementTimeLocked(
double value) {
212 timeLocked_ += value;
215 inline double timeWaitingToLock()
const {
216 return timeWaitingToLock_;
219 inline void incrementTimeWaitingToLock(
double value) {
220 timeWaitingToLock_ += value;
223 inline int deterministic()
const {
224 return deterministic_;
227 inline int maxDeleteNode()
const {
228 return maxDeleteNode_;
231 inline void setMaxDeleteNode(
int value) {
232 maxDeleteNode_ = value;
235 inline int nDeleteNode()
const {
239 inline void setNDeleteNode(
int value) {
240 nDeleteNode_ = value;
243 inline void clearDelNode() {
248 inline void fakeDelNode(
CbcNode ** delNode) {
252 inline CbcNode ** delNode()
const {
256 inline void setDelNode(
CbcNode ** delNode) {
260 inline int numberTimesLocked()
const {
261 return numberTimesLocked_;
264 inline int numberTimesUnlocked()
const {
265 return numberTimesUnlocked_;
268 inline int nodesThisTime()
const {
269 return nodesThisTime_;
272 inline void setNodesThisTime(
int value) {
273 nodesThisTime_ = value;
276 inline int iterationsThisTime()
const {
277 return iterationsThisTime_;
280 inline void setIterationsThisTime(
int value) {
281 iterationsThisTime_ = value;
284 inline int * saveStuff() {
288 inline bool locked()
const {
293 CbcSpecificThread threadStuff_;
301 double timeWaitingToLock_;
302 double timeWaitingToStart_;
303 double timeInThread_;
304 double timeWhenLocked_;
305 int numberTimesLocked_;
306 int numberTimesUnlocked_;
307 int numberTimesWaitingToStart_;
315 int iterationsThisTime_;
347 void stopThreads(
int type);
355 int waitForThreadsInTree(
int type);
361 void waitForThreadsInCuts(
int type, OsiCuts * eachCuts,
int whichGenerator);
364 void deterministicParallel();
369 inline void lockThread() {
370 children_[numberThreads_].lockThread();
375 inline void unlockThread() {
376 children_[numberThreads_].unlockThread();
380 inline bool isLocked()
const {
381 return children_[numberThreads_].locked();
388 inline CbcModel * model(
int i)
const {
389 return threadModel_[i];
393 inline CbcThread * child(
int thread)
const 394 {
return children_+thread;}
397 inline int numberThreads()
const 398 {
return numberThreads_;}
401 void setDantzigState();
416 OsiObject ** saveObjects_;
418 int defaultParallelIterations_;
419 int defaultParallelNodes_;
Information required while the node is live.
Simple Branch and bound class.
A class to encapsulate thread stuff.