后台工作人员在中间停下来
我正在后台工作人员中启动一个进程,比如说 abc.exe。一开始一切正常,但在新创建的进程之间,即 abc.exe 停止。虽然我将 abc.exe 作为隐藏窗口启动,但当它停止进行日志写入时,我开始了解它的挂起。
当我关闭 UI 表单时,abc.exe 再次开始工作。
谁能告诉我这可能是什么原因?
我无法调试该问题,因为它随时可能发生,我无法复制它。
请告诉我,因为这对我来说非常紧急。如果需要更多信息,请返回。
I am starting a process lets say abc.exe in a background worker. In the beginning everything works fine but in between the newly created process i.e. abc.exe halts. Although I am starting abc.exe as hidden window but I come to know about its hang as it stops doing log writing.
When I close my UI form then again abc.exe starts working.
Can anybody tell me what could be the possible cause for this?
I am not able to debug the issue as it can happen at any time, I can not replicate it.
Please tell me as it is very urgent for me. If some more info is required then please revert back.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这与用于创建线程而不是进程的后台工作程序无关。我怀疑您正在尝试使用您创建的进程的 StdIn/StdOut ?
如果您没有正确从标准输出流读取数据,进程通常会挂起。 有一个示例说明如何执行此操作正确并避免 MSDN 上的死锁。
This has nothing to do with background worker which is for creating threads, not processes. I suspect you are trying to use the StdIn/StdOut of the process you created?
It is common for a process to hang like that if you aren't reading from the standard output stream correctly. There's an example of how to do this correctly and avoid deadlocks on MSDN.