进程产生的线程可以在多核系统的不同核心上运行吗?
假设我有一个进程 P,从中生成了两个线程 t1 和 t2,它是一个具有两个核心 C1 和 C2 的多核系统。我的问题是:
I have a python program that has to be running all the time. If for some reason it was stopped I want to restart it automatically. I thought of having a cron that will run every n number of seconds and check the program is running. My shell script is looks like this:
#!/usr/bin/env bash
CM_COMMAND=`ps aux| grep abc| grep def| grep sudo`
LEN_COMMAND=${#CM_COMMAND}
if[["$LEN_COMMAND" -le "5"]]
then
echo "start the python program"
fi
exit
Run Code Online (Sandbox Code Playgroud)
When I run this script …