英文:
Is there a way to wait after sending a signal to a process?
问题
当一个信号(比如os.Interrupt)被发送给一个[进程]时,进程会等待直到完成进程吗?还是我们需要等待一段时间后才能继续?
英文:
When a signal (like os.Interrupt) is sent to a process, does the process waits until finish the process? Or, do we have to wait some time after?
答案1
得分: 0
我认为你在问发送信号是否会等待进程完成?
答案是这取决于平台和发送的信号类型以及进程对信号的处理方式。一些信号(如Kill)无法被捕获,会导致进程终止。其他信号在进程不处理它们时不会产生任何效果。还有一些信号,如果进程不处理它们,会有一些默认操作,但进程也可以根据需要处理它们以执行不同的操作。在我了解更多关于你的问题之前,这是我能给出的最好答案。
英文:
I think you are asking if sending a signal will wait till the process is finished?
The answer is that it depends on the platform and the type of signal you send and what the process does with the signal. Some signals such as Kill can't be caught and will cause the process to terminate. Others don't do anything unless the process handles them. Still others will do something if the process doesn't handle them but the process can handle it if it want's to do something different. Until I know more about what you are asking this is the best answer I can give.
答案2
得分: 0
你必须等一会儿(或者很长时间,甚至可能是永远,这取决于信号的处理方式)。
英文:
You have to wait a moment (or a long time, maybe even forever, depending on how the signal is being handled).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论