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 ronaldoussoren
Recipients Ericg, davin, pitrou, ronaldoussoren
Date 2020-10-31.12:44:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1604148255.32.0.752516127386.issue32937@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2020-10-31 12:44:15ronaldoussorensetrecipients: + ronaldoussoren, pitrou, davin, Ericg
2020-10-31 12:44:15ronaldoussorensetmessageid: <1604148255.32.0.752516127386.issue32937@roundup.psfhosted.org>
2020-10-31 12:44:15ronaldoussorenlinkissue32937 messages
2020-10-31 12:44:14ronaldoussorencreate