#include "MEDCouplingMemArray.hxx"
-#include "ctpl.h"
-
#include <map>
#include <list>
#include <vector>
#include <ostream>
#include <boost/filesystem.hpp>
+#include <boost/asio/thread_pool.hpp>
#ifdef WIN32
#pragma warning(disable:4251) // Warning DLL Interface ...
std::ostream& Dump(std::ostream & save);
- // Data for parallel computation
+ // Parallel computation functions
void Lock() {_my_lock.lock();};
void Unlock() {_my_lock.unlock();};
int GetNbThreads(){return _NbThreads;};
void SetNbThreads(int nbThreads){_NbThreads=nbThreads;};
- void InitPoolThreads(){_pool = new ctpl::thread_pool(_NbThreads);};
+ int GetMesherNbThreads(){return _MesherNbThreads;};
+ void SetMesherNbThreads(int nbThreads){_MesherNbThreads=nbThreads;};
+
+ void InitPoolThreads(){_pool = new boost::asio::thread_pool(_NbThreads);};
+ void DeletePoolThreads(){delete _pool;};
+
+ void wait(){_pool->join(); DeletePoolThreads(); InitPoolThreads(); }
bool IsParallel(){return _NbThreads > 0;}
// Temporary folder used during parallel Computation
boost::filesystem::path tmp_folder;
- // TODO: Replace by number of thread
- ctpl::thread_pool * _pool = nullptr; //thread pool for computation
+ boost::asio::thread_pool * _pool = nullptr; //thread pool for computation
private:
// Mutex for multhitreading write in SMESH_Mesh
std::mutex _my_lock;
int _NbThreads=0;
+ int _MesherNbThreads=0;
protected:
SMESH_Mesh();
SMESH_Mesh(const SMESH_Mesh&) {};
};
-
#endif