[cpp-threads] Asynchronous Execution Issues (caching_async)

Beman Dawes bdawes at acm.org
Wed Apr 29 21:13:14 BST 2009


On Wed, Apr 29, 2009 at 3:13 PM, Boehm, Hans <hans.boehm at hp.com> wrote:
>
> ...
>
> I guess my concern here is that we've managed to get a combination of features in the language
> (destructors for thread_locals and statics, detached threads, allocator instances, ...) that really
> don't play together very well.  And the fact that they don't is too subtle.  Lawrence's exercise has
> pointed this out.  Caching_async makes things worse, but the fact that anything along those lines
> is so hard to get right worries me more.  I think we're unintentionally planting too many traps here.
>
> I'm not sure what the best way is to fix this.

One way to attack the problem is for those who understand it (or at
least understand the symptoms) to write a paper identifying the
issues. Preferably with code snippets and anything else that would
allow a wider range of people to understand the serious issues.

>  In fact I'm not even sure whether this should be a core
> or library issue.  But I do think it needs to get discussed.  At a minimum, I think we need a bunch
> of notes pointing out the traps.  And ideally they should contain usage recommendations that avoid
> the traps.

Yes, and in the process of working out the notes for traps and
recommendations, ideas might surface for ways to eliminate or mitigate
at least some of the problems.

The work on async() needs to continue in parallel, too, because it is
needed on its own merits, related to public comments, and because if
there are language or library problems that cause async() to be
unreliable or error prone we need to know about them sooner rather
than later. If the standard library doesn't contain async(), users
will just write it themselves, so the issues aren't going to go away.

--Beman



More information about the cpp-threads mailing list