Day 1PFx: Task - A Unified Threading API
When the Parallel Framework Extensions (PFx) were first announced it looked as though it was going to target a narrow set of requirements around parallelizing processor intensive code. Over time the scope of the library has grown significantly such that it will become the main model for building asynchronous code. The pivotal type enabling this transition is the Task class. This is a functionally very rich type allowing the creation of both short and long lived asynchronous work, Tasks can have dependencies on one another and support cancellation. In this, the first of the PFx modules we look specifically how this class gives us a unified framework for building multithreaded code.
Thread Safety
Asynchronous programming requires careful attention to detail since most objects are not designed with multithreaded access in mind. This module introduces the importance of Interlocked and Monitor-based synchronization.
PFx: Synchronization Primitives and Concurrent Data StructuresEver since its inception .NET has had support for a number of synchronization primitives (such as Interlocked, Monitor and Mutex). However, on their own these primitives do not provide support for more complex synchronization situations and so people have had to use them as building blocks to build things like efficient Semaphores. PFx finally brings to the library a set of richer primitives such as lazy initialization, a lightweight semaphore and a countdown event. But more than this, it also introduces a set of high performance concurrent data structures that allow you to use them without you having to provide your own synchronization logic around them. This module looks at this new set of tools in your synchronization toolbox.
Day 2PFx: ParallelThe initial goal of PFx was to simplify the parallelization of processor intensive tasks - and this remains a key feature. This part of its functionality is focused on the Parallel class and it's For and ForEach members. In this module we look at the simplified model but also highlight that parallelizing algorithms is never as simple as it might first seem - we show you some of the pitfalls that you should be aware of when trying to parallelize functionality using the Parallel class.
Code ContractsEnsuring code both works as intended and is used by others as intended can be non-trivial. Imagine you had the ability to state the pre-conditions for calling a method and the post conditions for the state of an object when the method was complete. This would go a long way to helping the situation. Then imagine that tools could use this information to ensure that the code was correct *at compile time*. This is the purpose of code contracts - a mechanism for annotating your code and tooling to verify those annotations. This module introduces code contracts and how you can use them to improve the quality of yours and other people's code.
Inside the Garbage CollectorThe garbage collector has been part of .NET since its inception. However, exactly how the GC works is often shrouded in mystery. Also the fact that memory management is automated doesn't release the developer from caring about memory issues - it's just those memory issues appear in a different guise. In this module we take the lid of the GC, look at how it works and is optimized and then assess what this means for you when you are writing your code: things you do that can help the GC and things that cause it problems.
Day 3Debugging with Visual Studio - beyond the basicsVisual Studio is the primary development tool for .NET developers. It includes a very rich debugging environment of which often developers have only scratched the surface. This module looks at some of the more advanced tools that are built into visual studio for debugging.
Advanced Debugging - ToolingSome kinds of bugs require tools beyond visual studio to track down. In this module we look at other tools that you can use to, for example, capture and analyze crash dumps, profile your code generally gain deeper insight into what's really going on in that buggy application.
Advanced Debugging - TechniquesNow we have seen some of the more advanced tools at our disposal we can look at how they can be used to diagnose complex problems like multithreaded and memory related bugs. This module shows different techniques for solving common complex debugging issues.
Day 4Building Reflection Based FrameworksLoose coupling is a major design goal in systems. Every time you take a dependency on a concrete type you couple components together. Therefore, "programming to interface" is an important technique - however, somewhere you have to use new to create the actual concrete implementation … or do you? Reflection is a loose coupling API that not only allows you to create objects in a late bound fashion but also, if required to invoke them. Heavily reflection based code can have performance issues, but the introduction of dynamic typing into C# helps alleviate some of the problems with very little effort from you. This module explores the techniques and issues around building reflection based software.
Building loosely coupled applications with Inversion of ControlAlthough reflection allows you to build loosely coupled systems, frameworks have already been created that take advantage of this and provide a streamlined API to create loosely coupled systems. These frameworks are built around the concept of Inversion of Control and Dependency Injection and pivot around containers called IoC Containers. In this module we look at what IoC containers can do for you and introduce one of many called Unity.
Building Composite Applications with the Managed Extensibility FrameworkAt first sight MEF looks like yet another IoC container. However, its focus is subtly different - composing pluggable applications from separate components. Armed with an understanding of IoC we look at what MEF does that is the same and what it does that is different, giving you options when you come to build composite applications.