parallel processing - Multiprocessing a python script -


i learnt multiprocessing tool in python: https://docs.python.org/2/library/multiprocessing.html.

say have python program complicated , fleshed out, not use cores when running. uses 100% of 1 core , takes forever complete. hard me go program's code , figure out how split processes manually, cause program complicated.

is possible write simple python script enables multiprocessing on python program specify? exact, want simple this:

from multiprocessing import process  process(myprogram.py) 

if not, there next-best method?

after discussion, straight answer is:

no.

simply because multi-processing not magical trick automatically offloads burden on 1 processor another. developer needs know how program should split task, , specify each task should take new process.

so ultimately, have in control of code in order produce proper , efficient multi-processing.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -