Friday, April 21, 2017

Task.Delay Challenge Solution This post suggest solution to the Task.Delay challenge. If you haven’t read the Task.Delay challenge you can find it here. In nutshell the challenge was about making Task.Delay like functionality which is test-able (using IScheduler for having virtual time). In order to support virtual time I will use Rx’s stream (which is also awaitable). The original Task.Delay is actually having 2 different completion path: - Complete by time. - Complete as result of cancellation token event. The general idea of the solution is to have 2 Rx’s streams one for each completion path: - Timer...

Tuesday, April 4, 2017

This is a short teaser for what I’m planning to talk about in the next upcoming SDP conference. If you happened to be in Israel on May 2017 you can still register to the talk. The audience for this session expected to have prior knowledge about TPL, async / await and parallel programming in general. On this full day workshop I will focus on the less familiar aspects and patterns. Beyond Async And Await Planed Agenda * Task from different angle * Task.Run vs Task.Factory.StartNew * async / await drill down and custom awaitable * Some...

Wednesday, February 10, 2016

TPL Dataflow Starvation Fixed Great news for all TPL Dataflow developers. The old bug (more than a year since I reported it) was finally fixed at version 4.5.24. now it is safe to use fallback scenario with TPL Dataflow. for example: if you’re having 2 face recognition algorithm: * excellent but slow * fine and fast and you want to use those algorithm on a video streams without getting to much behind. You can limit the Bounded Capacity of the excellent algorithm’s block, link the two algorithm’s blocks to a buffer block. As long as the excellent...

Saturday, April 19, 2014

TPL Dataflow Starvation UPDATE: The bug had fixed on version 4.5.24 (after more than a year since I report it) and now it is finally safe to use the fallback scenario . this post is dealing with TPL Dataflow issue that may cause starvation.the TPL Dataflow team aware of it, so we can expect it to be fix in the near future.until then, you should be aware of it in order to avoid potential starvation of some of your Dataflow Blocks. so when does it happens? the starvation will happens when you have 2 blocks which is linked...

Monday, March 31, 2014

Code Paste during the years I maintains code snippets as notes for myself.recently goes over it and thought it might be useful to some of you, so I decided to publish it on my blog. you can see my code snippet at http://codepaste.net/searchall you have to do is to fill the "By" filed with my name and click search. enjoy it

Saturday, March 22, 2014

Observable.FromAsync is it the right choice? one of the most common RX's practice is to use Observable.FromAsync for executing asynchronous IO operations. typical code may look like: Code Snippet var webClient = new WebClient(); IObservable<string> uris = ...; var dataStream = from uri in uris from data in Observable.FromAsync( () => webClient.DownloadDataTaskAsync(uri)) select data; behind the scenes RX set a Task continuation (ContinueWith) and propagate the result through AsyncSubject, actually it is a bit complex and messy implementation combination with TPL Dataflow (.NET 4.5) may offer better solution to asynchronous...

Monday, December 23, 2013

Code Samples for my SDP Sessions the SDP conference was ended last week. with a few days delay the code sample for my sessions is now available. all the code for both days (TPL and Async Programming and Advanced Parallel Composition) available in here. Enjoy :-)

Code Samples for my SDP Sessions the SDP conference was ended last week. with a few days delay the code sample for my sessions is now available. all the code for both days (TPL and Async Programming and Advanced Parallel Composition) available in here. Enjoy :-)

Wednesday, May 8, 2013

The 3rd day of the SDP was over and I want to thanks all the attendants. my yesterday session was about C# 5 async and await. today I will have a full day tutorial on Rx and TPL Dataflow. you can download the demo code and also the presentation for second and third days from here (the link is also having the demo code for today's sessions). anyway, I also want to recommend 2of yesterday session. if you were attend at the conference you should have an access to...

Tuesday, May 7, 2013

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.