multiprocessing - Blocking subprocess function in Python? -


i had asynchronous function being called this:

from multiprocessing import process  def my_function(arg1, arg2):     print 'long process begins'  p = process(target=my_function, args=(arg1, arg2,)).start() 

how can make blocking? need finish process before running rest of script.

use p.join()

block calling thread until process join() method called terminates or until optional timeout occurs.

if timeout none there no timeout.

a process can joined many times.

a process cannot join because cause deadlock. error attempt join process before has been started.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -