Hello, All! I want to do something like this: Wrapper wrapper(final_handler); w_handler1 = wrapper.wrap(handler1); ... w_handlerN = wrapper.wrap(handlerN); where the final_handler() must be invoked as soon as all the wrapped handlers handler1() ... handlerN() are invoked through w_handler1() ... w_handlerN() in any order. Is there any existing Boost tool for that? -- Best regards, Vadim Guchenko [yhw at relost dot net].
Vadim Guchenko wrote:
Hello, All!
I want to do something like this:
Wrapper wrapper(final_handler); w_handler1 = wrapper.wrap(handler1); ... w_handlerN = wrapper.wrap(handlerN);
where the final_handler() must be invoked as soon as all the wrapped handlers handler1() ... handlerN() are invoked through w_handler1() ... w_handlerN() in any order. Is there any existing Boost tool for that?
It is not 100% clear to me what you want, but I'd say you could use promise/future from Boost Thread: http://www.boost.org/doc/libs/1_41_0/doc/html/thread/synchronization.html#th... You would have promise1..N which are set by handler/wrapper1..N. The final wrapper would have to wait for the synchronous future values 1..N and could proceed afterwards. HTH Roland
Some months ago I uploaded a portable Wait For Multiple Objects
implementation based on boost.thread in the vault, it seems relevant
to your problem.
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
On Mon, Dec 7, 2009 at 1:49 PM, Roland Bock
Vadim Guchenko wrote:
Hello, All!
I want to do something like this:
Wrapper wrapper(final_handler); w_handler1 = wrapper.wrap(handler1); ... w_handlerN = wrapper.wrap(handlerN);
where the final_handler() must be invoked as soon as all the wrapped handlers handler1() ... handlerN() are invoked through w_handler1() ... w_handlerN() in any order. Is there any existing Boost tool for that?
It is not 100% clear to me what you want, but I'd say you could use promise/future from Boost Thread:
http://www.boost.org/doc/libs/1_41_0/doc/html/thread/synchronization.html#th...
You would have promise1..N which are set by handler/wrapper1..N.
The final wrapper would have to wait for the synchronous future values 1..N and could proceed afterwards.
HTH
Roland _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Emil Dotchevski
-
Roland Bock
-
Vadim Guchenko