Browse by Tags
All Tags »
Task (
RSS)
Async / Await for .NET 4, Silverlight and Windows Phone if you have to target .NET 4, Silverlight and Windows Phone and still want to use the async / await pattern. the BCL team provide you with a new NuGet package named Microsoft.Bcl.Async . this package was announced as stable a few week ago. so you can check it out if you're having VS 2012 but should target one of the above platforms. be aware that this package won't work with 2010.
EF 6: Async this post is the first in a series about what's new in EF 6 . great improvements are about to come with Entity Framework 6 . it is a major release and the first one since EF become an open source. each post in the series will be dedicate to a single feature. this post will focus on a new EF a-sync features. the first question that should be asked is, why do we need parallel data access ? moreover why do we need a dedicate parallel data access API , rather then using the TPL Task.Run...
Parallel and The C# Memory Model Parallel programming can be tricky , both compiler and CPU's optimization can lead into a twilight zone's debugging. lets take the following code snippet snippet: Code Snippet class Program { static void Main( string [] args) { Console .WriteLine( "Start" ); var u = new Util (); u.Exec(); Console .ReadKey(); } } public class Util { private bool _stop = true ; public void Exec() { Task t = Task .Run(() => { bool b = true ; while (_stop) { b = ...
Immutable Collections Immutability is a pattern which is suit well parallel programming , but you have to be aware of a potential memory pressure risk when it's not implemented right or used wisely. this post will cover a new BCL library (still in its preview stage) which is targeting immutable collections . .NET is already having Concurrent implementation for Queue, Stack, Bug and Dictionary, which is thread-safe , but other type of collection like List is missing. another type of collection...
Open House at Microsoft yesterday I was lecturing at Microsoft about VS 2012, .NET 4.5, async/await, Rx and TPL Dataflow. there was 90 people attended and I hope that everybody has learn something new. the code sample for this lecture available here .
Async and AggregateException this post is a complementary to Eran Stiller's post . I was reading Eran Stiller's post about exception handling using async methods and I want to add a few side notes. 1) the exception handling behavior decisions is well documented in this post (by the TPL team), it decided after they had consider different options. 2) I was suggesting that compiler will check whether the a catch of AggregateException is implemented and if so to avoid the unwrapping behavior...
Tpl Dataflow TOC Part 1 Part 2 : ITargetBlock Part 3 : ISourceBlock Part 4 : Block structure Part 5 : walkthrough
Will it crash my process here is a short question, it was taken from a real life bug that occurs at one of my customers . will the following code crash the process? Code Snippet List < object > items = new List < object >(); try { Parallel .For(0, 10000000, t => { items.Add( "1" ); }); } catch ( AggregateException ex) { } it is a non thread safe code that should throw an IndexOutOfRangeException. but it wouldn't crash the process, but what about the following code? Code...
Async - Handling multiple Exceptions the SDP conference was ended a few week ago and I finally find a time to write some comments. It was a very successful conference, the feedback and evaluations, of most sessions scored higher than 4.5, some well-over it. For example, one workshop had a perfect 5 / 5 score , and two other workshops scored 4.92 / 5 and 4.9 / 5. The highest score for a breakout session was 9.39 / 10, which is the highest score we’ve seen to date. my score was 4.90 / 5 . but this...
SDP 2012 - Day 2 the SDP 2012 conference has day 2 had completed. I was speaking about async / await , Rx and TPL Dataflow . you can find the materials for my lecture in here . I will give the same lecture on Wednesday next week, there is a chance that some place is still available, so if you are interesting, you can check it with Sela Marketing .
SDP 2012 - Day 1 the SDP 2012 conference has started today. I was speaking about what's new in .NET 4.5 parallelism . you can find the materials for my lecture in here . tomorrow I'm giving a full day tutorial about async / await, Rx and TPL Dataflow .
Sela conferences (SDP) is coming near (25-29/3/2012). you can check the following link for all the SDP's tutorials and sessions http://www.sela.co.il/s/SDP2012/index.html . I will present 2 full-day tutorials (Yaniv Rodenski will join me on the first one). the first day Introduction to the Task Parallel Library is a full TPL 4 day which will give you a solid knowledge, HowTo and Consideration about building parallel application using the TPL library. at the end of this day we will...
Parallel.ForEach behavior this post is a direct continuation for the previous post about " Real-life story: Blocking Collection ". (Real-life story: Blocking Collection).ContinueWith (t => this post); or await (Real-life story: Blocking Collection); this post; my colleague Bram Veldhoen has suggest to demonstrate the behavior of the Parallel.ForEach thread's hunger in more pure fashion which doesn't include BlockingCollection<T> or any other high level Enumerable. the following...
Real-life story: Blocking Collection this post will discuss a real-life story which uncover none trivial (yet logical) behavior which related to Parallel.ForEach and BlockingCollection<T> . I will explain why it happens and what how can we handle it right. it all start when Guy Eden from ITG has found that the following code seem to leak memory : Code Snippet private static void Main() { var bc = new BlockingCollection < int >(); Task .Factory.StartNew(() => Parallel .ForEach(bc.GetConsumingEnumerable...
Tpl Dataflow walkthrough - Part 5 this post is a complete walkthrough of a web crawler sample that was build purely by using Tpl Dataflow . it was built on .NET 4.5 / C# 5 (on a virtual machine using VS 11 ). I will analyze each part of this sample, both by discussing the Dataflow blocks and the patterns in used. the sample code is available in here (it is a VS 11 project). during the walkthrough you will see the following Tpl Dataflow blocks: TransformBlock TransformManyBlock ActionBlock BroadcastBlock...
More Posts
Next page »