DCSIMG
April 2010 - Posts - Asaf Shelly

April 2010 - Posts

My Conclusions on Parallel Computing
Sunday, April 11, 2010 10:33 AM

After practicing parallel computing for a long while I have decided that it is time to summerise things as I see them so far. See the post in the link below:

My Conclusions on Parallel Computing

Asaf

Exception by target of an invocation
Thursday, April 01, 2010 6:38 PM

Parallel Programming means that we use invocations more often than we did before. Visual Studio 2008 debugger will bring you to the correct line if you get an exception, but if you invoke a method within your own code the debugger will show you the location in your own thread, which means the line that invoked the code that eventually threw an exception. The exception would say "Exception has been thrown by the target of an invocation.".

To solve this and really find the location of your exception you can drill down into the inner-exception member of the exception or use the following coding style:

void MyInvokedFunction( ){   try   {      ... some code ...   }   catch (Exception exp)   {      if (Debugger.IsAttached) Debugger.Break();      else throw;   }

}

This will cause the debugger to stop at the source of the exception even if it was thrown by another thread.