Showing results for async - Developer Support

May 13, 2014
0
0

So many exceptions… but only one can throw

Andrew Arnott
Andrew Arnott

When a method may throw for more than one reason, the thoughtful programmer might ask “which exception should be thrown?”Consider a method which performs argument validation, is cancelable, and also might throw based on the state of the object. What order should these validations occur so that the best exception is thrown? Here is my ow...

andarno.NETasync
Dec 28, 2012
0
0

The cost of context switches

Andrew Arnott
Andrew Arnott

Context switches are not free. But how expensive are they? I wrote a small program to find out, and I’m sharing the program and its results here. I focused on purely context switches (no work is actually performed between context switches). So it’s not a real-world scenario, but it really brings out the hidden costs. Below are the results 500,000 ...

andarno.NETasync