Why does this launch an infinite loop of new processes?

A

Andrew Berg

I am trying to understand the multiprocessing module, and I tried some
simple code:

import multiprocessing
def f():
print('bla bla')
p = multiprocessing.Process(target=f)
p.start()
p.join()

And the result is a new process that spawns a new process that spawns a
new process ad infinitum until I log out and the OS forcefully
terminates all my user processes. I have no idea what is happening; I
expected it to just print the string and terminate.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top