00001 00023 #ifndef GALOIS_RUNTIME_THREADPOOL_H 00024 #define GALOIS_RUNTIME_THREADPOOL_H 00025 00026 #include "Galois/config.h" 00027 #include GALOIS_CXX11_STD_HEADER(functional) 00028 00029 namespace Galois { 00030 namespace Runtime { 00031 00032 typedef std::function<void (void)> RunCommand; 00033 00034 class ThreadPool { 00035 protected: 00036 unsigned maxThreads; 00037 ThreadPool(unsigned m) :maxThreads(m) {} 00038 public: 00039 virtual ~ThreadPool() { } 00040 00043 virtual void run(RunCommand* begin, RunCommand* end, unsigned num) = 0; 00044 00046 unsigned getMaxThreads() const { return maxThreads; } 00047 }; 00048 00050 ThreadPool& getSystemThreadPool(); 00051 00052 } //Runtime 00053 } //Galois 00054 00055 #endif