Message380058
This issue can probably be closed as out of date:
Using: Python3.9, installer from python.org. On my laptop os.cpu_count() == 8.
"python -c 'import repro; repro.main()' works for me (it runs a while and exists when all workers have exited). The repro module contains the code below, this is the code from the original message with some changes because of changes to the multiprocessing launcher strategy on macOS.
# repro.py
import multiprocessing
from multiprocessing import Pool, Manager
import time
import random
def worker_function( index, messages ):
print( "%d: Entered" % index )
time.sleep( random.randint( 3, 15 ) )
messages.put( "From: %d" % index )
print( "%d: Exited" % index )
def main():
manager = Manager()
messages = manager.Queue()
with Pool( processes = None ) as pool:
for x in range( 30 ):
pool.apply_async( worker_function, [ x, messages ] )
pool.close()
pool.join()
# EOF |
|
Date |
User |
Action |
Args |
2020-10-31 12:44:15 | ronaldoussoren | set | recipients:
+ ronaldoussoren, pitrou, davin, Ericg |
2020-10-31 12:44:15 | ronaldoussoren | set | messageid: <1604148255.32.0.752516127386.issue32937@roundup.psfhosted.org> |
2020-10-31 12:44:15 | ronaldoussoren | link | issue32937 messages |
2020-10-31 12:44:14 | ronaldoussoren | create | |
|