I need to run some native C++ code in such way that if it crashes it doesn t affect my C# program. I can use an out-proc COM server with "single use" activation so that each COM object instance is hosted in a separate process.
现在,我建立了一套工人座椅,每个座椅都树立了这个共同点。 我还建立了“监视”线,将照顾到工人的read子。
Suppose the watchdog thread notices that the latest call to the out-proc object has been running for two days already and this likely means that the object code has just hung. So it wants to restart the process and needs the process id for that. How does it find the process id?
我认为,手头方式是,标语采用<代码>GetProcessId()的接口,而客户则要求采用这种方法并储存这一过程。
有什么其他办法?