Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asynchronous CreateProcess?

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?

like image 617
ssilsbee Avatar asked Sep 21 '11 23:09

ssilsbee


1 Answers

CreateProcess and its variants are all you've got. If the blocking hurts you then a different thread is the only solution.

like image 161
David Heffernan Avatar answered Sep 28 '22 05:09

David Heffernan