Detach own process from Windows Command Prompt

折月煮酒 提交于 2020-01-16 16:31:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!