Pausing a process?

前端 未结 4 1200
轻奢々
轻奢々 2020-12-17 17:29

Is there a way to pause a process (running from an executable) so that it stops the cpu load while it\'s paused, and waits till it\'s unpaused to go on with its work? Possib

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-17 18:11

    you are thinking of SIGTSTP -- the same signal that happens when you push CTRL-Z. This suspends the process until it gets SIGCONT.

    of course, some programs can just catch and ignore this signal, so it depends on the executable. however, if you can suspend and resume it manually, you can do it from a python program, too. use os.kill()

提交回复
热议问题