Boost logo

Boost :

From: Matthew Vogt (mvogt_at_[hidden])
Date: 2004-03-08 17:55:32


Slawomir Lisznianski <slisznianski <at> asyncnet.com> writes:

> During discussions on possible extensions to Boost.Threads, concept of
> Futures came up rather frequently. Below, I&#8217;d like to introduce a
> particular implementation available at www.rhapsodia.org of which
> requirements were defined as follows:
>
> 1. Provide means to register exception types with a "Future Registry".
>
> Rationale: I find it imperative that users should not have to define a
> list of exception types on each invocation yielding a Future object.
> Instead, provide the ability to register exception types with a Future
> Registry and bundle it with Future objects. I feel that compile time
> registration should be sufficient.

Do you have any practical examples of how the exception registry would be used?
To me it seems limiting that the set of exceptions must be bounded, to the
extent of not allowing polymorphic exception types. If all possible exceptions
generated by an asynchronous task are going to be sliced back to, say, an
std::runtime_error or logic_error, then the future might just as well return
a single type Future::Exception whose 'what' method returns the original
text of whatever type of exception was generated by the actual task.

Would it be possible to replace the variant with an any to get polymorphic
exception types?

>
> <snip> lots of stuff I agree with
>

Do you have a plan of things you'd like to do with your scheduler? I hadn't
realised you were adding futures to your work - I guess you might be doing
other interesting things :)

Matt


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk