I am currently converting a database stored procedure call to be asynchronous, leveraging async/await. Similar to the method described here.
Based on this answer, I'd like to verify that asynchronous call is actually using I/O completion ports. If it's ultimately waiting on another thread from the ThreadPool, then it is effectively defeating the purpose of converting the call.
What is the best way to verify that an I/O completion port is being used and it's not simply blocking on another thread?
Invoke WAITFOR DELAY '1:00:00'
1000 times in parallel. If far less than 1000 threads are being used, you are getting threadless IO. You should see a few dozens (which includes lots of utility threads started by runtimes and frameworks).
You can also break with the debugger and make sure that no thread is currently waiting for IO. You can tell from the stack trace. This works with any existing application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With