
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2017-06-29 20:01 bypitrou, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 2417 | merged | pitrou,2017-06-29 20:01 | |
| PR 3007 | merged | pitrou,2017-08-06 15:10 | |
| Messages (5) | |||
|---|---|---|---|
| msg297304 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2017-06-29 20:01 | |
We already use the _Py_atomic APIs in ceval.c, for lockless boolean flags. We should do the same in the signal module where there are similar concurrency issues (for example between the signal handler running in one thread and PyErr_CheckSignals running in another thread). | |||
| msg297313 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2017-06-29 20:22 | |
There is a sig_atomic_t type. Should we use that one?https://www.gnu.org/software/libc/manual/html_node/Atomic-Types.html"To avoid uncertainty about interrupting access to a variable, you can use a particular data type for which access is always atomic: sig_atomic_t. Reading and writing this data type is guaranteed to happen in a single instruction, so there’s no way for a handler to run “in the middle” of an access." | |||
| msg297315 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2017-06-29 20:25 | |
Look at the PR :-) That's what we used. But, while sig_atomic_t guarantees that accesses are atomic, it doesn't enforce a memory order. So the CPU (depending on the architecture) is free to reorder writes. | |||
| msg298478 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2017-07-17 10:25 | |
New changeset2c8a5e4c968217f9672340e520942c4ed788d8de by Antoine Pitrou in branch 'master':bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state (#2417)https://github.com/python/cpython/commit/2c8a5e4c968217f9672340e520942c4ed788d8de | |||
| msg299806 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2017-08-06 17:32 | |
New changeset57e836cb41656ac23042886db6b5985c036a7ce2 by Antoine Pitrou in branch '3.6':[3.6]bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state (GH-2417) (#3007)https://github.com/python/cpython/commit/57e836cb41656ac23042886db6b5985c036a7ce2 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:48 | admin | set | github: 74991 |
| 2017-08-06 17:32:41 | pitrou | set | messages: +msg299806 |
| 2017-08-06 15:10:26 | pitrou | set | pull_requests: +pull_request3041 |
| 2017-07-17 10:25:40 | pitrou | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2017-07-17 10:25:21 | pitrou | set | messages: +msg298478 |
| 2017-06-29 20:25:23 | pitrou | set | messages: +msg297315 |
| 2017-06-29 20:22:45 | vstinner | set | messages: +msg297313 |
| 2017-06-29 20:01:26 | pitrou | set | pull_requests: +pull_request2553 |
| 2017-06-29 20:01:06 | pitrou | create | |