views:

878

answers:

1

hi,

I want to use the boost threadpool library from open source(http://threadpool.sourceforge.net/) I am getting an complilation error with the example program itself.

/usr/include/boost/./threadpool/./detail/locking_ptr.hpp: In constructor âboost::threadpool::detail::locking_ptr::locking_ptr(volatile T&, const volatile Mutex&) [with T = boost::threadpool::detail::pool_core >, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>, Mutex = boost::recursive_mutex]â:

/usr/include/boost/./threadpool/./detail/pool_core.hpp:331: instantiated from âbool boost::threadpool::detail::pool_core::resize(size_t) volatile [with Task = boost::function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â

/usr/include/boost/./threadpool/size_policies.hpp:75: instantiated from âstatic void boost::threadpool::static_size::init(Pool&, size_t) [with Pool = boost::threadpool::detail::pool_core >, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>]â

/usr/include/boost/./threadpool/pool.hpp:103: instantiated from âboost::threadpool::thread_pool::thread_pool(size_t) [with Task = boost::function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â

./example/mergesort/mergesort.cpp:152: instantiated from here

/usr/include/boost/./threadpool/./detail/locking_ptr.hpp:50: error: âclass boost::recursive_mutexâ has no member named âlockâ

/usr/include/boost/./threadpool/./detail/locking_ptr.hpp: In destructor âboost::threadpool::detail::locking_ptr::~locking_ptr() [with T = boost::threadpool::detail::pool_core >, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>, Mutex = boost::recursive_mutex]â:

/usr/include/boost/./threadpool/./detail/pool_core.hpp:331: instantiated from âbool boost::threadpool::detail::pool_core::resize(size_t) volatile [with Task = boost::function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â

/usr/include/boost/./threadpool/size_policies.hpp:75: instantiated from âstatic void boost::threadpool::static_size::init(Pool&, size_t) [with Pool = boost::threadpool::detail::pool_core >, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>]â

/usr/include/boost/./threadpool/pool.hpp:103: instantiated from âboost::threadpool::thread_pool::thread_pool(size_t) [with Task = boost::function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â

./example/mergesort/mergesort.cpp:152: instantiated from here

/usr/include/boost/./threadpool/./detail/locking_ptr.hpp:58: error: âclass boost::recursive_mutexâ has no member named âunlockâ

Can someone help to solve this issue?

Regards, Anandan

+2  A: 

Seems like it's not compatible with boost version you have installed. What Boost version you have?

Aleksei Potov
BOOST_LIB_VERSION "1_33_1" ... got this from boost/version.hpp file.
Anandan
The docs seem to indicate that they were using Boost 1.37. There was a pretty serious rewrite of Boost.thread shortly after 1.33.1 was released. I would upgrade to a newer version of Boost.
D.Shawley
ok.. i will try updating the boost package and check..
Anandan