Language Support for Asynchronous Programming

Sign in to queue

The Discussion

  • User profile image

    I'm glad to see so many questions about async\await.  Hopefully a similar pattern will show up in other languages... hint, hint, C++ Smiley  Keep up the amazing work!!!

  • User profile image

    And it even works on the latest mono

  • User profile image

    Is the source code for that sample app available anywhere?

  • User profile image

    @AceHack: it is possible to wait for the result of an asynchronous operation in C++ using PPL tasks.

    It may need conversion from IAsyncOperation<> to a Concurrency::task<> and then you can use Concurrency::task<>::get() to comfortably achieve the same thing as await.

    auto classificationOp = runClassification(result->docText, result->lang);
    Platform::String^ classification = classificationTask.get();

  • User profile image

    @milgner I think this would be a blocking wait and it think it will only work in Metro style apps.  I was really hoping for a await language feature in C++ that would do the auto continuation (state machine) kind of thing like C# (Non Blocking).  Herb mentioned having this language feature possibly in the future with his talk here

    It took a while for that video to go up so I was completely unaware that Herb was already thinking about await as a C++ language extension or I would not have mentioned it again.  Thanks all language guys at Lang.Next, I've been very impressed.

Add Your 2 Cents