Boost.Thread: Support for variadic templates

Are there plans for Boost.Thread to support variadic templates sometime soon? We'd use c++0x, but it looks like there's no plan to support timed_join and interruption/cancellation. Will Boost.Thread continue to do so though or is there something I'm missing in regards to c++0x? Thanks! - Daniel P.S. I asked basically the same question on the boost user list, but go no response. See http://thread.gmane.org/gmane.comp.lib.boost.user/66171.

Daniel Neuberger <daniel.neuberger@gmail.com> writes:
Are there plans for Boost.Thread to support variadic templates sometime soon?
Boost.Thread relies on boost::bind. As such, it won't support variadic templates until boost::bind does.
We'd use c++0x, but it looks like there's no plan to support timed_join and interruption/cancellation.
You're right: interruption was too controversial, and timed_join imposes too much overhead on some implementations. If you need the equivalent, use std::async(std::launch::async,thread_func) to start your thread, and use wait_for/wait_until on the returned std::future.
Will Boost.Thread continue to do so though or is there something I'm missing in regards to c++0x?
There are no plans for Boost.Thread to drop interruption or timed_join. Anthony -- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++0x thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

On 03/09/2011 03:07 AM, Anthony Williams wrote:
Boost.Thread relies on boost::bind. As such, it won't support variadic templates until boost::bind does. Any idea when boost::bind will support variadic templates? Any reason Boost.Thread couldn't add the option to use std::bind instead?
We'd use c++0x, but it looks like there's no plan to support timed_join and interruption/cancellation.
You're right: interruption was too controversial, and timed_join imposes too much overhead on some implementations. If you need the equivalent, use std::async(std::launch::async,thread_func) to start your thread, and use wait_for/wait_until on the returned std::future. Any there any workarounds for interruption? Possibly using Boost?
Thanks. - Daniel

Daniel Neuberger <daniel.neuberger@gmail.com> writes:
On 03/09/2011 03:07 AM, Anthony Williams wrote:
Boost.Thread relies on boost::bind. As such, it won't support variadic templates until boost::bind does. Any idea when boost::bind will support variadic templates?
No.
Any reason Boost.Thread couldn't add the option to use std::bind instead?
It's more work for me ;-)
We'd use c++0x, but it looks like there's no plan to support timed_join and interruption/cancellation.
You're right: interruption was too controversial, and timed_join imposes too much overhead on some implementations. If you need the equivalent, use std::async(std::launch::async,thread_func) to start your thread, and use wait_for/wait_until on the returned std::future. Any there any workarounds for interruption? Possibly using Boost?
Interruption is invasive. Every function you wish to be an interruption point has to be wrapped with interruption checks, and you'll have to wrap the thread object with something that can hold the interruption data. Take a look at the implementation of interruption for pthreads in boost trunk, to see the convolutions necessary just for interruptible condition variable waits. Anthony -- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++0x thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976
participants (2)
-
Anthony Williams
-
Daniel Neuberger