Re: [boost] [defer/thread_pool] - added again to boost vault

Do you have some code to do that? not yet (no time)
Should we use code from the existing futures library in the vault? I tried it but it has a bug known by the author Thorsten Schuett. Sadly he has no idee to fix it.
I haven't looked at the asio code for a while. Does it offer futures? don't know
Is there scope for making defer_point::defer not only return a future value, but also directly take parameters and eliminate the slightly cumbersome bind steps? e.g.
Hmm - I'm defer function objects from member function of objects to defer_point. So I prefer the bind step. regards, Oliver

Hi Oliver, <Oliver.Kowalke <at> qimonda.com> writes:
Do you have some code to do that? not yet (no time)
same
Is there scope for making defer_point::defer not only return a future value, but also directly take parameters and eliminate the slightly cumbersome bind steps? e.g.
Hmm - I'm defer function objects from member function of objects to defer_point. So I prefer the bind step.
I'm thinking it might be possible to extend defer to do the binding within the defer request - so from callers perspective a_deferpoint.defer( boost::bind( &some_class::some_member, param1, param2 ) ); is written as a_deferpoint.defer( &some_class::some_member, param1, param2 ); where the latter invocation means effectively bind and defer execution. Pro's 1. simpler for end users 2. if the defer object decides the call can be done immediately, then possibly it can optimise out the bind step. Cons 1. implementing as a template instance method on defer exposes boost::bind to all clients of defer_point. (which tends to favour a free function approach like defer::bind_and_defer( a_deferpoint,&some_class::some_member, param1, param2 ) which can be in an optionally included header file. 2. More a question really - is it possible to write such a template function (or group of function given variable number of parameters) that wraps boost::bind and calls defer with the result. Cheers Simon

a_deferpoint.defer( boost::bind( &some_class::some_member, param1, param2 ) ); is written as a_deferpoint.defer( &some_class::some_member, param1, param2 ); where the latter invocation means effectively bind and defer execution.
Of course that should read something more like a_deferpoint.defer( boost::bind( &some_class::some_member, some_instance, param1, param2 ) ); and a_deferpoint.defer( &some_class::some_member, some_instance, param1, param2 ); Cheers Simon
participants (2)
-
Oliver.Kowalke@qimonda.com
-
Simon Meiklejohn