I have noticed that in my application, CreateProcessWithTokenW sometimes blocks for a very long time (up to 20 seconds) before returning. It is not acceptable to block my main thread for this long, so I'm considering moving the call onto a background thread. However, I'm wondering if there is a better, built-in way of doing an asynchronous CreateProcess, perhaps using overlapped operations or the like. Does anyone know whether such a thing exists?
CreateProcess and its variants are all you've got. If the blocking hurts you then a different thread is the only solution.
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