« Return to Thread: Review Request: future library (Gaskill version)

Re: Review Request: future library (Gaskill version)

by Peter Dimov-5 :: Rate this Message:

Reply to Author | View in Thread

Frank Mori Hess:

> Would support for releasing a future's reference count be acceptable in
> this
> scheme?  That is, something like
>
> future<void> fire();
> //...
> {
> future<void> forget = fire();
> forget.release(); // promise is not cancelled when forget destructs
> }

Good point about fire and forget tasks. I'm not sure I have a satisfactory
answer yet. There is no way to distinguish a result-only task from a
perform-side-effects task automatically, so the user must have some way to
say which is which.

On the other hand, a newly created promise doesn't have a cancel handler by
default, so whoever installs the cancel handler (the executor) can easily
take an argument that disables said installation.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

 « Return to Thread: Review Request: future library (Gaskill version)