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

E2E: Concurrent Programming with Revisions

Download

Right click “Save as…”

 

 

Building applications that are responsive and can exploit parallel hardware poses an important challenge. In particular, enabling applications to execute various tasks in parallel can be difficult if those tasks exhibit read and write conflicts. Revisions are forked and joined much like asynchronous tasks. However, rather than accessing global shared data directly (and thereby risking data races or atomicity violations), all revisions execute on a (conceptual) copy of the shared state, a "global mutable snapshot" so to speak. Any changes performed in a revision apply to that snapshot only, until the revision is joined at which the [sic] changes become globally effective [source = http://research.microsoft.com/en-us/projects/revisions/].

Here, Erik Meijer interrogates (in a nice way) computer scientists Daan Leijen and Sebastian Burckhardt, the researchers behind Revisions. As usual, Erik asks great questions and the scientists spend much of the time at the whiteboard, drawing and writing answers to clearly explain what revisions are, how they work, and why this model matters. In a nice twist of fate, Erik was Daan's PhD advisor at Utrecht University in the Netherlands (that must have been awesome—lucky Daan!).

Revisions are yet another example of the great work coming out of the RiSE group in MSR. You don't have to wait for a "CTP" of Revisions for C# -> Just go to http://rise4fun.com/Revisions and write some code! Thanks to Peli and the RiSE team developers for implementing such an awesome web-based experimentation sandbox.

Tune in. Learn. Enjoy.

 

Tags:

Follow the Discussion

  • Achim FriedlandAchim Friedland

    Very amazing work! But is there any conceptional difference to the multi version concurrency control (mvcc) concept database vendors like Oracle had been using for years to handle and resolve transactions?

  • V<T> : T would be so helpful!  So would ext methods which allow a ref this <Type> <name> Smiley

  • felix9felix9 the cat that walked by itself

    sound like a variation of STM ... but more explicit controlled ...

    V<T> needs mixins ? or covariance ? hmm...

  • William Staceystaceyw Before C# there was darkness...

    Think what is really cool is ability to declare your data and invariants as data at the top level, and enforce those invariants globally.  This would make debug and verification easier as you can break any time an invariant meets a rule, and not have to do it all over the place.  Then you can easily jump to the offending code/thread.  Also easier to declare your rules once and let runtime and compiler enforce the rules.

    Would also seem like an interesting new place to hookup "events"/hooks for data changes.  The join could notify any subscribers (e.g. IObservers).  

    Not sure I understand what happens when child wins and parent losses in general.  Does the parent restart?  Could you explain with some kind of UI and backing store example?  TIA !

  • JulesJules

    Very interesting work! How does this relate to the commute operation in Clojure's STM? You can update a variable with commute:
    (commute x f args)
    This does x = f(args) but it does not cause transaction retrying, because it is assumed that f commutes with the other updates. For example:
    (commute x + 1)
    Are there examples of sets of operations where it's impossible to define a working merge function?
    With transactions as you mention there is no guarantee that join r1, join r2 happens in that order, or the other way around. This causes nondeterminism, but it reduces conflicts. Is there a way to say "join r1 and r2 but I don't care in which order as long as r1 and r2 happen atomically"?
    Have you guys thought about potential applications to constraint programming? It seems to me that forks are very similar to computation spaces in Mozart/Oz. In constraint programming you often want to try out values and see whether it leads to a solution. If it doesn't lead to a solution you want to revert back. Your work with versions probably makes this very easy to implement.

  • JulesJules

    Oh great. It ate my markup.

  • CharlesCharles Welcome Change

    @Jules: Post formatting is a known bug we're investigating. Sorry about that.

    C

  • _ivan_ivan

    Very interesting. I like to see Erik, he reminds me of my college professors :)

  • JulesJules

    Looking at the source it seems that the newlines are preserved. The fix should be as easy as text.Replace("\n", "<br>").

  • typical microsoft crap typical microsoft crap

    @Charles: when you want to piss of the users use azure and silverlight, good work microsoft
    now all we need is another vista

  • CharlesCharles Welcome Change

    @typical microsoft crap : How is this commentary related to managed concurrent programming using revisions? It's fine to have an opinion (and you can share them freely on Channel 9 as long as you do so in a respectful manner), but you also need to provide concrete context and reason, not just emotion (clearly, you are not a fan of Microsoft....) if you want/expect to have intelligent debate with us.

    C

  • Adam SpeightAdam​Speight2008 The Bandito Coder

    This video has suggested to me another idea.

    Spin up Speculative Tasks, which presume that a particular outcome has occurred and does the processing as it could be. If it turns out to be a wrong presumption, the Fork changes are ignored and the correct Fork's changes are applied.

    It would be like continuing in a parallel universe. I think that so long as the jump between "realities" is quick it could pay-off.

    With more and morecores destined  to appear in the future, lets put them to work.

     

    Expressed in vb.net accent.

    
    Dim  True_CTS As New CancellationTokenSource
    Dim False_CTS As New CancellationTokenSource
    
    '
    ' Create and define both speculative tasks
    '
    Dim Spec(1) As Task
    Spec(0)=Fork New Task(
      Sub()
       ' True Speculative Fork
      End Sub,
      True_CTS.Token)
    Spec(1)=Fork New Task(
      Sub()
       ' False Speculative Fork
      End Sub,
      True_CTS.Token)
    '
    ' Start Them
    '
    Spec(0).RunSync
    Spec(1).RunSync
    '
    ' 
    '
    Dim Pred As new Task(Of Boolean)(
      Async Function() As Boolean
       Dim bool as Boolean
       ' Rest
       Yield bool)
    Pred.RunSync
    Dim r = Pred.Wait
    If r Then
    False_CTS.Cancel
    Join Spec(1).Wait()
    '
    ' At this point the Changes made to the StateOfTheWorld in the True Speculative Task Apply
    '
    Else
    True_CTS.Cancel
    Join Spec(0).Wait()
    '
    ' At this point the Changes made to the StateOfTheWorld in the False Speculative Task Apply
    '
    End If 
    

  • Aaron StainbackAceHack AceHack

    So awesome to see you on here again Erik!!!

  • typical microsoft craptypical microsoft crap

    @Charles: that's funny in a sad way, i did try a few times the way you described and i was ignored every single time.
    Apparently being friendly and wanting to have an intelligent debate wasn't ( isn't ? ) very response worth.
    Many are having the same problem of being ignored by microsoft, i shouldnt name names...yet but for example a lot of security researchers have been ignored until they have released a detailed report publicly with information on how to exploit it.
    So by observation and experience: you have to be rude, make a lot of bad PR noise, and be very emotional to actually get a response.So the conclusion is: microsoft have huge communitarian problems (to put it in a friendly way)
    Should i even mention the feedback system ? hint: the msdn documentation feedback system
    I haven't noticed any improvement so far.

  • CharlesCharles Welcome Change

    @typical microsoft crap: You are free to express your opinions and ask questions on Channel 9. You know, your user name probably isn't the best since it's offensive to those who would communicate with you.... I mean, it's like saying "hey jerk, talk to me. Come here, get outta here!". That won't get you very far since you are dealing with humans, who have feelings. That's the essence of C9 - humans make software, after all. That said, this conversation can continue in the Coffeehouse, not on this thread, which is about programming concurrency... Please respect this. Thanks.

    C

  • mdkmdk

    Thank you for the cast Charles, very interesting stuff Smiley

    E2E with Erik is a must see, as he really maxes out the interview (so much for performance tuning!)

  • typical microsoft craptypical microsoft crap

    @Charles: my user name isn't offensive just an honest observation, i could give you examples of offensive user names but that would be offensive so i wont."this conversation can continue in the Coffeehouse"
     Translation: Post in the Coffeehouse so we can more easily ignore you and have less people read the truth about microsoft.
    Charles, if you don't like to be "offended" lock yourself in a room or move to the woods and don't interact with humans, sorry it's the only way. It would be delusional to think you can go though life thinking that you wont get offended when interacting with other humans in some way. My advice would be for you to get a thinker skin, switch to a less human interactive job or seek a psychologist.

  • typical microsoft craptypical microsoft crap

    @Charles: "not on this thread, which is about programming concurrency... Please respect this" PS: yes i can respect that and will.
    "Thanks"You're welcome.

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.