DCSIMG
Thread,exception - Bnaya Eshet

Bnaya Eshet

Disclaimer

Browse by Tags

All Tags » Thread » exception (RSS)
Will it crash my process
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 \ await and Exception Handling
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"...