Showing results for async - Developer Support

May 15, 2020
Post comments count0
Post likes count0

Resolved JavaScript Promises Can Be Used Multiple Times!

Developer Support
Developer Support

JavaScript Promises are powerful, and they become more powerful once we understand that a "resolved" Promise can be used more than once!

PremierJavaScriptasync
May 13, 2014
Post comments count0
Post likes count0

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
Post comments count0
Post likes count0

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