MEF 2.0 – mini series: Part 7 (Catalog filter and Deep hierarchic scoping)

Thursday, January 24, 2013

MEF 2.0 - mini series: Part 7 (Catalog filter and Deep hierarchic scoping) this is the 7th post in the MEF 2.0 mini series. you can see the following TOC for other posts in this series. in the previous post I was talking about composition scoping and lifetime management. on this one, I will extend the composition scoping topic toward hierarchic along with catalog filtering capability. hierarchic scoping is not trivial, you must understand the hierarchic behavior and what it was design for. MEF hierarchic...

Async and AggregateException

Monday, January 14, 2013

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. in this case the...

Will it crash my process

Monday, December 10, 2012

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?...

Async – Handling multiple Exceptions

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 post...
one comment

async \ await and Exception Handling

Thursday, January 12, 2012

async \ await and Exception Handling this post will discuss how async / await is handling exceptions. as we mention in previous post, about the async / await concept, await is all about continuation. before .NET 4.5 parallel execution exceptions has to be handle in separate of the synchronic handling. for example: handling ThreadPool execution: Code Snippet void Foo() {     try     {         Console.WriteLine("Synchronic");         ThreadPool.QueueUserWorkItem(state =>             {                 try                 {                     Console.WriteLine("Parallel");                 }                 catch (Exception exAsync)                 {                     EventLog.WriteEntry("application", exAsync.ToString());                 }             }, null);     }     catch (Exception ex)     {         EventLog.WriteEntry("application", ex.ToString());...