Python Multi-process
Because the Gil exists in Python, so the performance of multithreading is not good, so you want to fully use the multi-core CPU resources, you can use multi-process.
1.Process class
The process class is used to create the
Class multiprocessing. Process (Group=none, Target=none, Name=none, args= (), kwargs={}, *, Daemon=none)
Where group should always be empty, its existence is only with threading. Thread compatible, Threading,thread also has a group parameter, but now it is not used, reserved until later thread groups implemented later.
Target, a callable object that passes in a function that executes when the Run method is executed.
Name is the name that defines the process, and if this parameter is not defined, the default name is Process-x (x is the ordinal).
Args is a parameter tuple, and Kwargs is a dictionary that is passed to target as a parameter.
Parameter daemon can set whether the process is a daemon, and if it is empty, this parameter will inherit from the parent process.
Python Multi-process