且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

强制终止停留在某些方法的API调用上的线程

更新时间:2022-06-12 20:58:24

我认为,如果您不能依赖interrupt()语义,那么您可能会走运.没有可靠或安全的方法来强制终止线程.任何语言都是危险的.

I think if you can't rely on interrupt() semantics then you may be out of luck. There is no reliable or safe way to forcefully terminate a thread. It's dangerous in any language.

我希望interrupt()可以为您提供所需的内容,即使可以绕开它. CORBA调用应该通过标准的网络类,因此应该在任何阻塞的调用上正确地中断.

I would hope that interrupt() would get you what you need even if it could be circumvented. The CORBA calls should be going through the standard network classes and therefore should properly interrupt on any blocking calls.

除了产生完整的子进程之外,这是您所能做的***的事情.

It's the best you can do short of spawning full child processes.