multiprocessing.context.Process class

The Python class multiprocessing.Process represents a running process. Using this constructor of this class Process(), a process can be created and started. Process class has several attributes and methods to manage a created process.

Process Updated 2 Feb 2019 1 min read

Methods of the Process class
process() - The process ConstructorCreates a child process.
run()This method contains the code that is to be executed as a separate process. This method is similar to the run() method of the Thread class.
start()Calling start() executes the run method of the process instance.
join()When called on a process instance it blocks for the specified number of seconds or till the process on which it is called is complete.
is_alive()Checks whether a process is alive or not and returns the status.
terminate()Terminates the associated process.
kill()Kills the associated process.
close()Closes the process instance
Attributes of the Process class
nameThe name of the process. It is not unique. Multiple processes can have the same name.
daemonThe daemon status of the process.
pidProcess ID of the process.
exitcodeExit code of the terminated process.
authkeyThe authentication key of the process
sentinelThe numeric handle of the process. In Unix: This handle can be passed into methods like select(), while waiting for an event. In Windows: This handle can be used for waitforsingleobject() and waitformultipleobjects().