The loop method checks whether the subroutine is working, and if it is completed, it exits the loop and the stop method is triggered. It works correctly. But when the subprogram is killed, the CPU load from the web service (main program) rises by 300%.
I use OS Linux, Elementary OS
I already tried to set a delay for each iteration, it did’t help.
Structure E does not have a special meaning; we will assume that it serves to preserve the value of the PID. I can’t use Wait () because I need to return some data, and the command that I run can work forever, it’s a kind of daemon,and the Wait () method will wait for the completion of the subroutine.
And again, if I do not use the wait () method, when I kill a subroutine, I will get “process defunct”. That means process become zombie, he’s killed, but main process still waiting some action from subroutine