Multi-processing is used to do multiple tasks at a time in computer. It speeds up the process. We already have seen the difference between multiprocessing and threading. So, here we will study about how begin with multiprocessing. Python contains a multiprocessing module. This module has various functions available to create a process. Below is a piece of code to create a process. import multiprocessing ... p = multiprocessing.Process( target = function_name, args = (arg1,arg2,...)) p.start() p.join() ... Process is a function used to create a process. It has the target function which will be executed as the process begins and arguments for the target function as its arguments. Start() function will initiate the process and Join() function will wait till the process is finished.
To understand in a better way, visit the github link.
0 Comments
Leave a Reply. |
AuthorVinit is a computer scientist and roboticist. His research focuses on making machines intelligent. Categories |