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 Ben.thelen
Recipients Ben.thelen
Date 2011-10-19.15:28:01
SpamBayes Score 6.20219e-08
Marked as misclassified No
Message-id <1319038082.58.0.169311394229.issue13220@psf.upfronthosting.co.za>
In-reply-to
Content
print function unable while multiprocessing.Process is being run

Not sure if this really is a bug, but the multiprocessing.Process (or Pool) does not allow to print during multiprocessing tasks.

I've copied the example from The Python V3.2.2 documentation, library reference, multiprocessing (3rd example).

My systems details are: MS windows xp or Windows 7, IDLE, Python 3.2.2 [MSC v.1500 32 bit (Intel)] on win32

from multiprocessing import Process
import os

def info(title):
    print(title)
    print('module name:', __name__)
    print('parent process:', os.getppid())
    print('process id:', os.getpid())

def f(name):
    info('function f')
    print('hello', name)

if __name__ == '__main__':
    info('main line')
    p = Process(target=f, args=('bob',))
    p.start()
    p.join()


#return

#main line
#module name: __main__
#parent process: 1588
#process id: 3700

#but function f doesn't get printed.
History
Date User Action Args
2011-10-19 15:28:02Ben.thelensetrecipients: + Ben.thelen
2011-10-19 15:28:02Ben.thelensetmessageid: <1319038082.58.0.169311394229.issue13220@psf.upfronthosting.co.za>
2011-10-19 15:28:01Ben.thelenlinkissue13220 messages
2011-10-19 15:28:01Ben.thelencreate