GH-84559: Deprecate fork being the multiprocessing default. (#100618)

This starts the process. Users who don't specify their own start method
and use the default on platforms where it is 'fork' will see a
DeprecationWarning upon multiprocessing.Pool() construction or upon
multiprocessing.Process.start() or concurrent.futures.ProcessPool use.

See the related issue and documentation within this change for details.
This commit is contained in:
Gregory P. Smith 2023-02-02 15:50:35 -08:00 committed by GitHub
parent 618b7a8260
commit 0ca67e6313
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 284 additions and 63 deletions

View file

@ -2431,7 +2431,8 @@ class ReTests(unittest.TestCase):
input_js = '''a(function() {
///////////////////////////////////////////////////////////////////
});'''
p = multiprocessing.Process(target=pattern.sub, args=('', input_js))
mp = multiprocessing.get_context('spawn')
p = mp.Process(target=pattern.sub, args=('', input_js))
p.start()
p.join(SHORT_TIMEOUT)
try: