Beyond the C# Masterclass: Parallel and Asynchronous Programming in C# 5

January 31, 2013 at 4:04 pm Leave a comment

It’s been around a year and a half since I developed and started teaching Edument’s C# Masterclass. One of the things that I ask participants to do at the end is fill out an evaluation. While the nice scores give me a warm fuzzy feeling and tell me I deserve a good beer after three intesne days of teaching, the things I look at more thoughtfully are the suggestions for how things could have been done differently. The course as it stands today is not the same as when I first delivered it, and while some of that is me being proactive (for example, making sure it was updated for C# 5 in good time), much of it has been tweaks as a direct result of feedback. So, thank you to everyone who took the time!

One of the hardest problems I face when processing feedback – not just on this course, but on most of them – is that the number of suggestions for what could be added or covered more deeply is not matched by suggestions of what people didn’t want and thus can be removed. So far as I can tell, there’s very little that doesn’t pull its weight, and the course already has three very full days. So, what to do?

It turns out that many – more than half – of the “more about X” requests relate to the parallel programming section of the course. This perhaps isn’t so surprising; it’s an area that most developers – myself included – find fairly challenging, and yet are needing to work with more and more. Asynchronous programming has also grown in relevance over the years. As the demands on developers to work with parallel and asynchronous programming have grown, the C# and .NET teams at Microsoft haven’t been idle. In fact, they’ve been the very opposite, giving us a wide array of libraries and even language additions that relate to these areas.

That’s great, but it’s easy to feel lost in it all. I mean, we now have…

  • Good old threads and monitors
  • Interlocked (atomic) operations
  • Tasks
  • Concurrent collections
  • Parallel loops
  • PLINQ (Parallel LINQ)
  • The C# async/await keywords
  • A load of asynchronous methods to go with them
  • Reactive Extensions (Rx)
  • TPL Dataflow, offering Actor-based programming

There is a lot to say about how to apply any individual one of these, if we’re going to dig into fairly realistic scenarios rather than boring, unrealistic bank account examples. There’s even more to say about what problems they are ideal for solving, and how they can be used together.

There’s no way I can meaningfully do all of that in the C# Masterclass. For a whlie now I’ve finished the section on parallel programming – in which I try to give a high level overview of what’s there – with a quip that we could easily spend three more days digging into the details. That was originally a throwaway remark, but given the growing importance of the topic and the interest I’ve seen from participants, I’ve concluded it’s time to look at making those “three more days” happen.

So, after much research and pondering, I’m happy to announce a new course: “Parallel and Asynchronous Programming in C# 5”. Three days of teaching and labs, all about modern parallel and asynchronous programming on the .Net platform using C# 5. The course starts out with a look at some of the underlying principles and primitives, showing what the higher level parallel constructs are saving us from. It then proceeds to cover the concurrent collection types and uses for them, then parallel iteration. The next day is given over to focusing on asychrony: how async/await keywords work, how they help us, and then in the afternoon how to put Rx to work with streams of events in a powerful and compositional way. The final day will look at the TPL Dataflow library and its applications, Parallel LINQ, and then take a quick dive down to the low level again with a look at building things out of atomic operations – an advanced, yet fascinating topic.

A lot of the exciting things coming to the C# language and the .Net framework these days relate to parallel and asynchronous programming. If you’ve already taken the C# Masterclass and enjoyed it, these three days will provide a challenging followup covering increasingly relevant topics. If you haven’t taken the C# Masterclass and don’t wish to, but do like the look of this course, that’s also fine: just make sure you meet the course prerequisites.

I greatly look forward to delivering this course, and hope to see many of you there! 🙂



Entry filed under: Uncategorized. Tags: , , .

Community Day är tillbaka! We now have a Knockout course, and it rocks!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed

%d bloggers like this: