This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Kain94
Recipients Kain94
Date 2010-03-09.09:01:51
SpamBayes Score 1.9797196e-07
Marked as misclassified No
Message-id <1268125314.35.0.202558750367.issue8094@psf.upfronthosting.co.za>
In-reply-to
Content
Hi,

The following code results in an infinite loop -->

# ----
import multiprocessing

def f(m):
	print(m)

p = multiprocessing.Process(target=f, args=('pouet',))
p.start()
# ----

I've firstly think about an issue in my code when Python loads this module so I've added a "if __name__ == '__main__':" and it works well. But, with the following code Python enters in the same infinite loop -->

proc.py:

# ----
import multiprocessing

def f(m):
	print(m)

class P:
	def __init__(self, msg):
		self.msg = msg
	
	def start(self):
		p = multiprocessing.Process(target=f, args=(self.msg,))
		p.start()
# ----

my_script.py:
# ----
from proc import P

p = P("pouet")
p.start()
# ----

It's like Python loads all parent's process memory space before starting process which issues in an infinite call to Process.start() ...
History
Date User Action Args
2010-03-09 09:01:54Kain94setrecipients: + Kain94
2010-03-09 09:01:54Kain94setmessageid: <1268125314.35.0.202558750367.issue8094@psf.upfronthosting.co.za>
2010-03-09 09:01:52Kain94linkissue8094 messages
2010-03-09 09:01:51Kain94create