summaryrefslogtreecommitdiffstats
path: root/Modules/_multiprocessing
Commit message (Collapse)AuthorAgeFilesLines
* gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205)Eric Snow2023-05-052-0/+8
| | | Here we are doing no more than adding the value for Py_mod_multiple_interpreters and using it for stdlib modules. We will start checking for it in gh-104206 (once PyInterpreterState.ceval.own_gil is added in gh-104204).
* gh-102255: Improve build support for Windows API partitions (GH-102256)Max Bachmann2023-03-091-1/+3
| | | | | Add `MS_WINDOWS_DESKTOP`, `MS_WINDOWS_APPS`, `MS_WINDOWS_SYSTEM` and `MS_WINDOWS_GAMES` preprocessor definitions to allow switching off functionality missing from particular API partitions ("partitions" are used in Windows to identify overlapping subsets of APIs). CPython only officially supports `MS_WINDOWS_DESKTOP` and `MS_WINDOWS_SYSTEM` (APPS is included by normal desktop builds, but APPS without DESKTOP is not covered). Other configurations are a convenience for people building their own runtimes. `MS_WINDOWS_GAMES` is for the Xbox subset of the Windows API, which is also available on client OS, but is restricted compared to `MS_WINDOWS_DESKTOP`. These restrictions may change over time, as they relate to the build headers rather than the OS support, and so we assume that Xbox builds will use the latest available version of the GDK.
* bpo-15999: Accept arbitrary values for boolean parameters. (#15609)Serhiy Storchaka2022-12-032-13/+13
| | | builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.
* gh-90928: Improve static initialization of keywords tuple in AC (#95907)Erlend E. Aasland2022-08-132-87/+37
|
* gh-90928: Statically Initialize the Keywords Tuple in Clinic-Generated Code ↵Eric Snow2022-08-113-8/+191
| | | | | | | | | | | | | | | | (gh-95860) We only statically initialize for core code and builtin modules. Extension modules still create the tuple at runtime. We'll solve that part of interpreter isolation separately. This change includes generated code. The non-generated changes are in: * Tools/clinic/clinic.py * Python/getargs.c * Include/cpython/modsupport.h * Makefile.pre.in (re-generate global strings after running clinic) * very minor tweaks to Modules/_codecsmodule.c and Python/Python-tokenize.c All other changes are generated code (clinic, global strings).
* GH-94382: port multiprocessing static types to heap types (#94336)Kumar Aditya2022-07-203-63/+61
|
* GH-94736: Fix _multiprocessing.SemLock subclassing (#94738)Kumar Aditya2022-07-111-4/+2
| | | | | | | | | * fix allocator and deallocator * 📜🤖 Added by blurb_it. * code review Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-94512: Fix forced arg format in AC-processed multiprocessing (GH-94517)Oleg Iarygin2022-07-042-7/+33
|
* gh-91320: Argument Clinic uses _PyCFunction_CAST() (#32210)Victor Stinner2022-05-033-11/+11
| | | | Replace "(PyCFunction)(void(*)(void))func" cast with _PyCFunction_CAST(func).
* bpo-45847: Fix _multiprocessing on platforms without sem_open (GH-29833)Christian Heimes2021-11-294-11/+84
|
* bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587)Victor Stinner2020-12-011-1/+1
| | | | | | | | | No longer use deprecated aliases to functions: * Replace PyObject_MALLOC() with PyObject_Malloc() * Replace PyObject_REALLOC() with PyObject_Realloc() * Replace PyObject_FREE() with PyObject_Free() * Replace PyObject_Del() with PyObject_Free() * Replace PyObject_DEL() with PyObject_Free()
* bpo-1635741: Port _posixshmem extension module to multiphase initialization ↵Christian Heimes2020-11-191-13/+9
| | | | | (GH-23404) Signed-off-by: Christian Heimes <christian@python.org>
* bpo-1635741: Fix NULL ptr deref in multiprocessing (GH-22880)Christian Heimes2020-10-221-1/+0
| | | | | | Commit 1d541c25c8019f7a0b80b3e1b437abe171e40b65 introduced a NULL pointer dereference in error path. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-1635741: Port multiprocessing ext to multiphase init (GH-21378)Mohamed Koubaa2020-08-111-42/+60
| | | Port the _multiprocessing extension module to multiphase initialization (PEP 489).
* bpo-20175: Convert Modules/_multiprocessing to the Argument Clinic (GH-14245)Zackery Spytz2020-07-125-94/+797
|
* bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)Serhiy Storchaka2020-05-261-11/+1
| | | | Only __index__ should be used to make integer conversions lossless.
* bpo-40268: Remove unused structmember.h includes (GH-19530)Victor Stinner2020-04-151-1/+0
| | | | | | If only offsetof() is needed: include stddef.h instead. When structmember.h is used, add a comment explaining that PyMemberDef is used.
* bpo-39511: Fix multiprocessing semlock_acquire() (GH-18298)Victor Stinner2020-02-011-10/+11
| | | | The Python C API must not be used when the GIL is released: only access Py_None when the GIL is hold.
* Remove some unused defines in multiprocessing.h. (GH-15661)Sergey Fedoseev2019-09-071-10/+0
| | | | | It looks like they are unused since 87cf220972c9cb400ddcd577962883dcc5dca51a.
* bpo-37034: Display argument name on errors with keyword arguments with ↵Rémi Lapeyre2019-08-291-3/+3
| | | | Argument Clinic. (GH-13593)
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-2/+2
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-36127: Argument Clinic: inline parsing code for keyword parameters. ↵Serhiy Storchaka2019-03-141-7/+48
| | | | (GH-12058)
* bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264)Serhiy Storchaka2019-03-131-1/+1
|
* bpo-35813: Tests and docs for shared_memory (#11816)Davin Potts2019-02-242-668/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added tests for shared_memory submodule. * Added tests for ShareableList. * Fix bug in allocationn size during creation of empty ShareableList illuminated by existing test run on Linux. * Initial set of docs for shared_memory module. * Added docs for ShareableList, added doctree entry for shared_memory submodule, name refactoring for greater clarity. * Added examples to SharedMemoryManager docs, for ease of documentation switched away from exclusively registered functions to some explicit methods on SharedMemoryManager. * Wording tweaks to docs. * Fix test failures on Windows. * Added tests around SharedMemoryManager. * Documentation tweaks. * Fix inappropriate test on Windows. * Further documentation tweaks. * Fix bare exception. * Removed __copyright__. * Fixed typo in doc, removed comment. * Updated SharedMemoryManager preliminary tests to reflect change of not supporting all registered functions on SyncManager. * Added Sphinx doctest run controls. * CloseHandle should be in a finally block in case MapViewOfFile fails. * Missed opportunity to use with statement. * Switch to self.addCleanup to spare long try/finally blocks and save one indentation, change to use decorator to skip test instead. * Simplify the posixshmem extension module. Provide shm_open() and shm_unlink() functions. Move other functionality into the shared_memory.py module. * Added to doc around size parameter of SharedMemory. * Changed PosixSharedMemory.size to use os.fstat. * Change SharedMemory.buf to a read-only property as well as NamedSharedMemory.size. * Marked as provisional per PEP411 in docstring. * Changed SharedMemoryTracker to be private. * Removed registered Proxy Objects from SharedMemoryManager. * Removed shareable_wrap(). * Removed shareable_wrap() and dangling references to it. * For consistency added __reduce__ to key classes. * Fix for potential race condition on Windows for O_CREX. * Remove unused imports. * Update access to kernel32 on Windows per feedback from eryksun. * Moved kernel32 calls to _winapi. * Removed ShareableList.copy as redundant. * Changes to _winapi use from eryksun feedback. * Adopt simpler SharedMemory API, collapsing PosixSharedMemory and WindowsNamedSharedMemory into one. * Fix missing docstring on class, add test for ignoring size when attaching. * Moved SharedMemoryManager to managers module, tweak to fragile test. * Tweak to exception in OpenFileMapping suggested by eryksun. * Mark a few dangling bits as private as suggested by Giampaolo.
* bpo-35813: Added shared_memory submodule of multiprocessing. (#11664)Davin Potts2019-02-021-0/+724
| | | Added shared_memory submodule to multiprocessing in time for first alpha with cross-platform tests soon to follow.
* bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. ↵Zackery Spytz2018-12-071-3/+6
| | | | | | (GH-11015) Set MemoryError when appropriate, add missing failure checks, and fix some potential leaks.
* bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)Serhiy Storchaka2018-11-271-2/+2
| | | | | | Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS excluding Argument Clinic generated code.
* bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. ↵Siddhesh Poyarekar2018-04-291-5/+5
| | | | | | | | | (GH-6030) METH_NOARGS functions need only a single argument but they are cast into a PyCFunction, which takes two arguments. This triggers an invalid function cast warning in gcc8 due to the argument mismatch. Fix this by adding a dummy unused argument.
* bpo-31653: Remove deadcode in semlock_acquire() (#4091)Victor Stinner2017-10-231-4/+4
| | | | | | | | | | Fix the following Coverity warning: >>> CID 1420038: Control flow issues (DEADCODE) >>> Execution cannot reach this statement: "res = sem_trywait(self->han...". 321 res = sem_trywait(self->handle); The deadcode was introduced by the commit c872d39d324cd6f1a71b73e10406bbaed192d35f.
* bpo-31653: Don't release the GIL if we can acquire a multiprocessing ↵Antoine Pitrou2017-10-221-10/+20
| | | | semaphore immediately (#4078)
* bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)Serhiy Storchaka2017-04-162-4/+4
|
* bpo-6532: Make the thread id an unsigned integer. (#781)Serhiy Storchaka2017-03-231-1/+1
| | | | | | | | | | | * bpo-6532: Make the thread id an unsigned integer. From C API side the type of results of PyThread_start_new_thread() and PyThread_get_thread_ident(), the id parameter of PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState changed from "long" to "unsigned long". * Restore a check in thread_get_ident().
* Issue #28152: Fix -Wunreachable-code warning on clangVictor Stinner2016-12-051-2/+5
| | | | | Replace 0 with (0) to ignore a compiler warning about dead code on "((int)(SEM_VALUE_MAX) < 0)": SEM_VALUE_MAX is not negative on Linux.
* require a long long data type (closes #27961)Benjamin Peterson2016-09-061-1/+1
|
* Issue #27591: Merge from 3.5Berker Peksag2016-07-231-0/+3
|\
| * Issue #27591: Set sigint_event to NULL if _PyOS_IsMainThread() returns falseBerker Peksag2016-07-231-0/+3
| | | | | | | | Patch by Chris Angelico.
* | Issue #26924: Fix Windows buildbotsBerker Peksag2016-05-071-1/+1
| | | | | | | | | | | | | | | | sem_unlink is defined as #define SEM_UNLINK(name) 0 under Windows.
* | Issue #26924: Do not define _multiprocessing.sem_unlink under AndroidBerker Peksag2016-05-071-1/+1
|/ | | | Android declares sem_unlink but doesn't implement it.
* Issue #21704: Fix build error for _multiprocessing when semaphoresRichard Oudkerk2014-07-281-0/+2
| | | | are not available. Patch by Arfrever Frehtes Taifersar Arahesis.
* Fix conversion from Py_ssize_t to int.Richard Oudkerk2013-09-071-2/+4
|
* Issue #8713: Support alternative start methods in multiprocessing on Unix.Richard Oudkerk2013-08-143-14/+66
| | | | See http://hg.python.org/sandbox/sbt#spawn
* Reuse Py_MIN and Py_MAX macros: remove duplicate MIN/MAX macrosVictor Stinner2013-06-041-9/+0
| | | | multiprocessing.h: remove unused MIN and MAX macros
* - Fix typos in the multiprocessing module.doko@ubuntu.com2013-05-151-1/+1
|\
| * - Fix typos in the multiprocessing module.doko@ubuntu.com2013-05-151-1/+1
| |
* | Replace WaitForMultipleObjects with WaitForMultipleObjectEx,Martin v. Löwis2013-01-251-1/+1
| | | | | | | | for better WinRT compatibility.
* | Replace WaitForSingleObject with WaitForSingleObjectEx,Martin v. Löwis2013-01-251-2/+2
| | | | | | | | for better WinRT compatibility.
* | Issue #9586: Merge.Richard Oudkerk2013-01-011-0/+7
|\ \ | |/
| * Issue #9586: MergeRichard Oudkerk2013-01-011-0/+7
| |\
| | * Issue #9586: Redefine SEM_FAILED on MacOSX to keep compiler happy.Richard Oudkerk2013-01-011-0/+7
| | |
| | * Issue #10133: Make multiprocessing deallocate buffer if socket read fails.Richard Oudkerk2012-06-111-13/+16
| | | | | | | | | | | | Patch by Hallvard B Furuseth.