简体   繁体   中英

How do I kill a Python multiprocessing job?

In reference to this question I had asked, I can successfully run jobs using multiprocessing and I can see that all processors are being utilized. How do I kill this job? From terminal I run:

python my_multiprocessor_script.py

Then I hit Ctrl+C to kill.

However the job doesn't seem to be killed and I can see all the processors still in use. I'm running Red Hat Enterprise Linux Server release 6.6.

You should be able to do something like this.

Original Author

kill -9 `ps -ef | grep my_multiprocessor_script.py | grep -v grep | awk '{print $2}'`

also take a look at Python Multiprocessing Kill Processes for more info

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM