[Python-checkins] r64623 - python/trunk/Doc/whatsnew/2.6.rst

benjamin.peterson python-checkins at python.org
Tue Jul 1 21:51:55 CEST 2008


Author: benjamin.peterson
Date: Tue Jul 1 21:51:54 2008
New Revision: 64623
Log:
write a short little section for multiprocessing; it still needs help
Modified:
 python/trunk/Doc/whatsnew/2.6.rst
Modified: python/trunk/Doc/whatsnew/2.6.rst
==============================================================================
--- python/trunk/Doc/whatsnew/2.6.rst	(original)
+++ python/trunk/Doc/whatsnew/2.6.rst	Tue Jul 1 21:51:54 2008
@@ -526,7 +526,21 @@
 PEP 371: The ``multiprocessing`` Package
 =====================================================
 
-XXX write this.
+.. XXX I think this still needs help
+
+:mod:`multiprocessing` makes it easy to distribute work over multiple processes.
+Its API is similiar to that of :mod:`threading`. For example::
+
+ from multiprocessing import Process
+
+ def long_hard_task(n):
+ print n * 43
+
+ for i in range(10):
+ Process(target=long_hard_task, args=(i)).start()
+
+will multiply the numbers between 0 and 10 times 43 and print out the result
+concurrently.
 
 .. seealso::
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /