0

P1 と P2 の 2 つのプロセスがあります。2 番目のプロセス P2 は無限に実行されています。最初のプロセスが実行されると、2 番目のプロセスは最初のプロセスが完了するまで待機状態になります。

この状況を処理する最も簡単な方法を教えてください。

ありがとう !!

4

1 に答える 1

0

Your question is not very clear. But here's the options anyway:

 kill -s SIGSTOP $P2    #P2 - process id of P2

This will suspend the P2 which you can use when P1 is running and then do to continue:

 kill -s SIGCONT $P2

Or use wait in process P2:

wait $P1

This will wait until P1 gets over.

于 2012-09-26T19:22:18.107 に答える