locked
How do I make to create aync operations of my own consuming then with ppl?

    Question

  • Hi. I have my classes and I would like to create async operations on my classes just as WinRT does and use it within my application. How can I do this in just one project?

    Every exemplo I see demonstrates how to use async operations which come from Windows. I want to create my own async operations.

     

    Thank you.

    Claudio M. Souza Junior.

    Monday, October 17, 2011 7:34 PM

Answers

  • I’m happy to say that we just announced the availability of the async production sample pack – please see our blog post and try the accompanying samples:

    http://blogs.msdn.com/b/nativeconcurrency/archive/2011/10/27/try-it-now-use-ppl-to-produce-windows-8-asynchronous-operations.aspx

     


    Artur Laksberg - MSFT
    • Marked as answer by ClaudioMSJr Friday, October 28, 2011 6:34 PM
    Thursday, October 27, 2011 11:08 PM
  • Hi Claudio,

    We’re planning to do a refresh of the sample pack we released a few weeks ago and add a few samples on creation of async operations. I expect that it will happen in a couple of weeks or so. If you keep an eye on our blog at http://blogs.msdn.com/b/nativeconcurrency, you’ll be the first to know.

    As to how hard it is... The general-purpose solution that we’re contemplating is about 1000 lines of C++ code making copious use of template metaprogramming. Most of it will be in the header file so you can explore it yourself. While a less general solution can be less complex, you will still need to implement a base class, do the state management, error handling etc. At this moment I can’t go into more detail, but I will say that you will love how easy it is to author async operations with PPL – so hang in there!

    Artur Laksberg
    PPL team


    Artur Laksberg - MSFT
    Monday, October 17, 2011 8:57 PM

All replies

  • Hi Claudio,

    In the Developer Preview there isn't an easy way to create your own async operations.  We are aware of this shortcoming and are trying to solve it for the next pubic release.  In the meanwhile, you could design your API as async and we will provide guidance on how to convert sync to async.

    Thanks

    Raman Sharma, Visual C++

    Monday, October 17, 2011 7:47 PM
  • Is there not even a hard way for doing this while no such solution is available?

    In reality, it wouldn't bother me to do this the hard way while no easy solution is available. At least another means not encompessed in the WinRT, anything else?

     

    Thank you for any adivice.

    Claudio M. Souza Junior

    Monday, October 17, 2011 7:56 PM
  • Hi Claudio,

    We’re planning to do a refresh of the sample pack we released a few weeks ago and add a few samples on creation of async operations. I expect that it will happen in a couple of weeks or so. If you keep an eye on our blog at http://blogs.msdn.com/b/nativeconcurrency, you’ll be the first to know.

    As to how hard it is... The general-purpose solution that we’re contemplating is about 1000 lines of C++ code making copious use of template metaprogramming. Most of it will be in the header file so you can explore it yourself. While a less general solution can be less complex, you will still need to implement a base class, do the state management, error handling etc. At this moment I can’t go into more detail, but I will say that you will love how easy it is to author async operations with PPL – so hang in there!

    Artur Laksberg
    PPL team


    Artur Laksberg - MSFT
    Monday, October 17, 2011 8:57 PM
  • I’m happy to say that we just announced the availability of the async production sample pack – please see our blog post and try the accompanying samples:

    http://blogs.msdn.com/b/nativeconcurrency/archive/2011/10/27/try-it-now-use-ppl-to-produce-windows-8-asynchronous-operations.aspx

     


    Artur Laksberg - MSFT
    • Marked as answer by ClaudioMSJr Friday, October 28, 2011 6:34 PM
    Thursday, October 27, 2011 11:08 PM
  • Thank you very much for that elegant solution.

     

    Claudio M. Souza Junior.

    Friday, October 28, 2011 7:42 PM