00001 /* 00002 * Copyright (C) Sergey P. Derevyago, 2008-2009. 00003 * 00004 * Permission to copy, use, modify, sell and distribute this software is granted 00005 * provided this copyright notice appears in all copies. 00006 * This software is provided "as is" without express or implied warranty, and 00007 * with no claim as to its suitability for any purpose. 00008 * 00009 */ 00010 00016 #ifndef __DERS__THREAD_POOL_HPP__ 00017 #define __DERS__THREAD_POOL_HPP__ 00018 00019 #include <ders/config.hpp> 00020 #include <ders/task.hpp> 00021 00022 namespace ders { // ::ders 00023 00028 class thread_pool : virtual public destroyable { 00029 public: 00030 virtual void exec(task& tk, const dq_vec& dv)=0; 00031 }; 00032 00033 typedef sh_ptr<thread_pool> sh_thread_pool; 00034 00040 sh_thread_pool new_thread_pool(mem_pool& mp); 00041 00048 sh_thread_pool new_thread_pool(mem_pool& mp, int cnt); 00049 00050 } // namespace ::ders 00051 00052 #endif // __DERS__THREAD_POOL_HPP__ 00053