问题
I have a Windows command line process that currently performs a long I/O operation at the end (sending results to a server). Because I don't really have anything more to share with the user at that point*, I want to be able to give the user back their terminal before I begin the operation, while allowing the operation to finish in the background. How can I do this in my own application?
My first idea is to put the non-blocking logic into a separate process, but I'd like to investigate keeping it in the same process before diving headfirst into that.
*Well, there may be an error message, which I will have to figure out another way to show the user if it comes up. However, most of the time, the application is silent before the operation begins.
来源:https://stackoverflow.com/questions/55540119/detach-own-process-from-windows-command-prompt