Changeset 2085 for trunk


Ignore:
Timestamp:
Jan 14, 2015 3:53:19 AM (5 years ago)
Author:
forrest
Message:

allow for Mac pthreads

Location:
trunk/Clp/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpSimplex.hpp

    r2078 r2085  
    17281728#define DEVEX_TRY_NORM 1.0e-4
    17291729#define DEVEX_ADD_ONE 1.0
     1730#if defined(ABC_INHERIT) || defined(THREADS_IN_ANALYZE)
     1731#ifndef NORMAL_PTHREADS
     1732#define NORMAL_PTHREADS
     1733#endif
     1734#endif
    17301735#if defined(ABC_INHERIT) || defined(CBC_THREAD) || defined(THREADS_IN_ANALYZE)
    17311736// Use pthreads
     
    17611766  inline pthread_mutex_t * mutexPointer(int which,int thread=0)
    17621767  { return mutex_+which+3*thread;}
     1768#ifdef NORMAL_PTHREADS
    17631769  inline pthread_barrier_t * barrierPointer()
    17641770  { return &barrier_;}
     1771#endif
    17651772  inline int whichLocked(int thread=0) const
    17661773  { return locked_[thread];}
     
    17771784  // For waking up thread
    17781785  pthread_mutex_t mutex_[3*(NUMBER_THREADS+1)];
     1786#ifdef NORMAL_PTHREADS
    17791787  pthread_barrier_t barrier_;
     1788#endif
    17801789  CoinThreadInfo threadInfo_[NUMBER_THREADS+1];
    17811790  pthread_t abcThread_[NUMBER_THREADS+1];
  • trunk/Clp/src/ClpSolve.cpp

    r2080 r2085  
    56415641  threadInfo->status=-1;
    56425642  int * which = threadInfo->stuff;
     5643#ifdef NORMAL_PTHREADS
    56435644  pthread_barrier_wait(driver->barrierPointer());
     5645#endif
    56445646#if 0
    56455647  int status=-1;
     
    57135715    threadInfo_[iThread].status = 100;
    57145716  }
     5717#ifdef NORMAL_PTHREADS
    57155718  //pthread_barrierattr_t attr;
    57165719  pthread_barrier_init(&barrier_, /*&attr*/ NULL, numberThreads+1);
     5720#endif
    57175721  for (int iThread=0;iThread<numberThreads;iThread++) {
    57185722    pthread_create(&abcThread_[iThread], NULL, parallelManager, reinterpret_cast<void *>(this));
    57195723  }
     5724#ifdef NORMAL_PTHREADS
    57205725  pthread_barrier_wait(&barrier_);
    57215726  pthread_barrier_destroy(&barrier_);
     5727#endif
    57225728  for (int iThread=0;iThread<numberThreads;iThread++) {
    57235729    threadInfo_[iThread].status = -1;
Note: See TracChangeset for help on using the changeset viewer.