|
Boost Users : |
Subject: [Boost-users] [boost][thread] Future's scheduler
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2013-05-20 06:12:38
I'm using boost.thread V4 in my projects because I would like to use
futures.
I understand that boost 1.53 implementation of future.then() is incomplete
but I think it's ok
for my current use.
However I think there might be something missing.
I'm in a case where the user of my library provide his own task scheduler
(or executor)
which means that when I have functions that return futures, they will use
that scheduler.
I would like to limit the boilerplate necessary for the user to schedule
tasks properly
when one task is finished, so I assume the user will use then() with just
lambdas or function
pointers.
The documentation of then() says:
- When the scheduler or launch policy is not provided the continuation
inherits the parent's launch policy or scheduler.
Which is perfect to me as I just have to associate the first future with
the scheduler,
the user that will use .then() will not have to specify which scheduler to
use.
My problem is that I can't find how to associate a scheduler to a future
(without using .then()).
There is apparently no way to do this in boost::future or boost::promise
interfaces.
Am I missing something?
I see that I could use a dummy initial future just to build another future
with .then()
which would associate the second future with the scheduler, but this is
clearly just ductapping.
Joel Lamotte
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net