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 LambertDW
Recipients LambertDW, georg.brandl
Date 2008-10-24.16:54:35
SpamBayes Score 0.0010009002
Marked as misclassified No
Message-id <1224867277.0.0.802822144442.issue4193@psf.upfronthosting.co.za>
In-reply-to
Content
http://docs.python.org/dev/3.0/library/multiprocessing.html

I'm sure the examples have been thoughtfully contrived.  Still, this 
seems instructive without adding much complexity.  I'd change the 
first "trivial example" to

###########################################
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())
    print()

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()
###########################################

with output similar to


main line
module name: __main__
parent process: 12926
process id: 17002

function f
module name: __main__
parent process: 17002
process id: 17004

hello bob
History
Date User Action Args
2008-10-24 16:54:37LambertDWsetrecipients: + LambertDW, georg.brandl
2008-10-24 16:54:37LambertDWsetmessageid: <1224867277.0.0.802822144442.issue4193@psf.upfronthosting.co.za>
2008-10-24 16:54:36LambertDWlinkissue4193 messages
2008-10-24 16:54:35LambertDWcreate