Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Anders Hejlsberg: Introducing Async – Simplifying Asynchronous Programming

Download

Right click “Save as…”

Microsoft Technical Fellow and C# creator Anders Hejlsberg explains the new C# and VB.NET asynchronous programming model, available as Async CTP now, which makes async programming much easier for .NET developers.

Tags:

Follow the Discussion

  • MichaelMichael

    Async CTP link doesn't work

  • CharlesCharles Welcome Change

    @Michael: Will work soon. Sorry, I jumped the gun Smiley
    C

  • felix9felix9 the cat that walked by itself

    oh, they are doing it for C# too, when this emerges on PDC08 IIRC its a VB language feature, oh right they are co-evolving now, mmm...

  • CharlesCharles Welcome Change

    @felix9: What are you talking about? Watch the video...

    C

  • felix9felix9 the cat that walked by itself

    uhhh...maybe its just my first sight of these stuff are demoed in vb language ... heh Tongue Out

    busy watching PDC now ...

  • Bent Rasmussenexoteric stuck in a loop, for a while

    Iterators and async, IEnumerable and IObservable, state machines and duality, oh yes, LINQs abound.

    Great explanation from Anders.

  • Isn't it amazing how how much easier it is to comprehend a complex subjecct when presented by someone with so much enthusiasm? Wink

    Great work Anders & Team. Can't wait to see what you attack next Big Smile

  • the async stuff sounds great. Any plans in C# to make dependency properties a part of the language? Having to understand and debug dependency properties made learning WPF kind of hard for me.

     

  • RafaelRafael

    Erm... how come no comment on IObservable? Seriously guys, you talked about IEnumerable, iterators and all the good stuff, but not a word on Rx? What hath thou done Charles? *rant*

  • CharlesCharles Welcome Change

    @Rafael: we talked about Rx in other interiews including the C9 Live session with Anders.
    C

  • Tommy CarlierTommyCarlier Widen your gaze

    I know you can't have try { ... } finally { ...} or using (...) { ... } inside an iterator in .NET 2.0. Do asynchronous methods have the same problem?

  • _ivan_ivan

    this is what I have throughout my program and it is very annoying just like Mr. Anders mentioned, inverse flow of control with 2 delegate callbacks one for regular return, the other one for exception. 
    EventHandler<T> failureHandler = null;
    EventHandler<T> successHandler = null;
     
    failureHandler = (s,ea) =>
    {
        obj.FailureEvent -= failureHandler;
        obj.SuccessEvent -= successHandler;
        // handle failed state
       ...
    };
     
    successHandler = (s,ea) =>
    {
        obj.FailureEvent -= failureHandler;
        obj.SuccessEvent -= successHandler;
        // handle success state
        ...
    };
     
    obj.SuccessEvent += successHandler;
    obj.FailureEvent += failureHandler;
    obj.RunAsync();
    I am very looking forward to this feature.
     

  • _ivan_ivan

    Hmm, I guess line break (carriage return) is not an option.

  • Does anyone know when this async stuff gets offically released? I guess my question is whether Async CTP is reliable enough to be incorporated into my product code.

  • Sparkywil2300 Super #

    Fantastic stuff, I need to read up on F#'s async some more and look at the TPL!

  • Elmerelmer I'm on my very last life.

    Did anyone else find themselves checking their inbox while watching that video ?

  • magicalclickmagicalclick C9 slogan, #dealwithit. WinPh8.1 IE empty tab crash and removable video control edition.

    For some reason, I really like this guy's attitude. Brilliance is one thing. Addressing the credit is one thing. But, something else makes me really put me in comfort with him. Maybe he makes it easier to understand for me. Or maybe some other reasons. So, I hope he continues his good work in MS and I hope MS values his work too. After all, I hope to use his stuff for a long long time.

  • @ elmer. Absolutely. But then I realized I didn't have Windows Live Mail open. Nice explanation Mr. Anders.

  • Bent Rasmussenexoteric stuck in a loop, for a while

    @elmer:Nope.

  • UncompetativeUncompetati​ve

    I don't mean to be mean, but Anders did dodge the final question. In having asynchrony done by the compiler you will lose control, so... how well is it optimised, what efficiency compromises are inherent in a solution that cannot be "hand-coded". Hejlsberg just turned around the question and answered it as if it had been about the comparatively minimal creeping featurism of the syntax.

  • Mrk MnlMrk Mnl

    Hmm.. I think this is more for the VB guys, its already easy using anonymous methods from C# for which this syntax is just a shortcut (I am guessing):
    someThread.BeginInvoke(new Action(delegate() 
     {
      // do something
    });
     
     

  • No Async love for Express editions? I tried installing the CTP (I have Visual Studio Web Developer and C# Express installed) but could not located the Async DLLs after.

  • Clint RutkasClint I'm a "developer"

    @ecofriend: let me find out as I'd love to use this in some Coding4Fun projects

  • Clint RutkasClint I'm a "developer"

    @ecofriend: got a response by the always wonderful LIsa Feigenbaum over at the MSDN forums.  http://social.msdn.microsoft.com/Forums/en-US/async/thread/4945ecf1-b242-4173-9ada-570c731bd3fb

    Quick answer is: current CTP is Visual Studio 2010 Professional, Premium or Ultimate only.  You can download a trial at http://www.microsoft.com/visualstudio/en-us/download

  • What if ALL functions will be decared async automatically? What are the implications of that?

  • @Clint: Thanks.

  • Avner AharoniAvner Aharoni

    @ecofriend: Express SKUs are not supported. you can download one of the trial version of Visual Studio from here http://www.microsoft.com/visualstudio/en-us/download

  • JulesJules

    Why did you choose to implement it so that an await statement can only be resumed once? For example you can't implement await on List (or most other monads for that matter):
     
    async List<int> CartesianProduct(List<int> A, List<int> B){
        var a = await A;
        var b = await B;
        return new Tuple(a,b);
    }

  • Rabeeh AblaRabeeh Abla

     
    Great work ! 

  • I'm sort of sad Sad Because of parallel and async tasks I had an argument to start learning F#. Now I have only wait for new C# Smiley 

  • CharlesCharles Welcome Change

    @Algida: Well. Don't be sad! And do learn F#. Also, learn other forms of parallel and async expression in C# using Tasks and Rx and Concurrent Revisions Smiley So much to learn. So little time.
    C

  • @Charles:Yup you are right, I just getting into current C# and .Net4, till I will get into f# there will be next c# it is so so little time to learn it Smiley 

  • CharlesCharles Welcome Change

    @Algida: As Herb Sutter always says, learn as many languages as you can. Make it entertainment so you actually do it (if you don't enjoy it then it will be hard to be entertained by it).This allows you to express problems and solutions with more tools, some being better suited for the specific job at hand. More importantly, it teaches you how to think about programmming in multiple dimensions (like functional (F#) and imperative/hybrid (C#)).

    You are right, of course. Start off with the fundamentals (just as reading music is to playing an intsrument or instruments in highly expressive ways). The music analogy only goes so far and some will be quick to point out the logical flaws therein, but you get the idea.

    C

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.