我可以将SIGCONT发送到正在运行的进程吗?

时间:2021-05-28 20:50:25

I know that SIGCONT continues a process previously stopped by SIGSTOP. Can I use SIGCONT multiple times without a SIGSTOP ? i,e , below sequence is valid ?

我知道SIGCONT继续之前由SIGSTOP停止的进程。没有SIGSTOP,我可以多次使用SIGCONT吗?我,e,以下顺序是有效的吗?

SIGSTOP to process A : The process stops
SIGCONT to process A : Process resumes
SIGCONT to process A : Process already runs - this SIGCONT has no effect 
SIGCONT to process A : Process already runs - this SIGCONT has no effect 
...
SIGSTOP to process A : The process stops
SIGCONT to process A : Process resumes

1 个解决方案

#1


8  

You can do it. TLPI says:

你能行的。 TLPI说:

When sent to a stopped process, this signal causes the process to resume (i.e., to be rescheduled to run at some later time). When received by a process that is not currently stopped, this signal is ignored by default. A process may catch this signal, so that it carries out some action when it resumes.

当被发送到停止的过程时,该信号使得该过程恢复(即,被重新安排以在稍后的某个时间运行)。当被当前未停止的进程接收时,默认情况下将忽略此信号。进程可以捕获此信号,以便在恢复时执行某些操作。

APUE:

Note that the default action for SIGCONT is to continue the process, if it is stopped; otherwise, the signal is ignored.

请注意,SIGCONT的默认操作是继续该过程(如果已停止);否则,信号被忽略。

#1


8  

You can do it. TLPI says:

你能行的。 TLPI说:

When sent to a stopped process, this signal causes the process to resume (i.e., to be rescheduled to run at some later time). When received by a process that is not currently stopped, this signal is ignored by default. A process may catch this signal, so that it carries out some action when it resumes.

当被发送到停止的过程时,该信号使得该过程恢复(即,被重新安排以在稍后的某个时间运行)。当被当前未停止的进程接收时,默认情况下将忽略此信号。进程可以捕获此信号,以便在恢复时执行某些操作。

APUE:

Note that the default action for SIGCONT is to continue the process, if it is stopped; otherwise, the signal is ignored.

请注意,SIGCONT的默认操作是继续该过程(如果已停止);否则,信号被忽略。