Title
Multiple exceptions from connected shared_future::get()?
Status
resolved
Section
[futures.shared.future]
Submitter
Thomas J. Gritzan

Created on 2009-04-03.00:00:00 last changed 162 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change [futures.shared_future]:

const R& shared_future::get() const;
R& shared_future<R&>::get() const;
void shared_future<void>::get() const;

...

-9- Throws: the stored exception, if an exception was stored and not retrieved before. [Note: Multiple calls on get() are allowed, and each call would result in an exception if an exception was stored. — end note]

Date: 2010-10-21.18:28:33

Rationale:

Resolved by paper N2997.

Date: 2010-01-23.00:00:00

[ 2010-01-23 Moved to Tentatively NAD Editorial after 5 positive votes on c++std-lib. ]

Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

We note there is a pending paper by Detlef on such future-related issues; we would like to wait for his paper before proceeding.

Alisdair suggests we may want language to clarify that this get() function can be called from several threads with no need for explicit locking.

Move to Open.

Date: 2009-04-03.00:00:00

It is not clear, if multiple threads are waiting in a shared_future::get() call, if each will rethrow the stored exception.

Paragraph 9 reads:

Throws: the stored exception, if an exception was stored and not retrieved before.

The "not retrieved before" suggests that only one exception is thrown, but one exception for each call to get() is needed, and multiple calls to get() even on the same shared_future object seem to be allowed.

I suggest removing "and not retrieved before" from the Throws paragraph. I recommend adding a note that explains that multiple calls on get() are allowed, and each call would result in an exception if an exception was stored.

History
Date User Action Args
2010-12-05 14:14:49adminsetstatus: nad editorial -> resolved
2010-10-21 18:28:33adminsetmessages: + msg751
2010-10-21 18:28:33adminsetmessages: + msg750
2010-10-21 18:28:33adminsetmessages: + msg749
2010-10-21 18:28:33adminsetmessages: + msg748
2009-04-03 00:00:00admincreate