cpython/Lib/asyncio
Pablo Galindo Salgado 42b25ad4d3
gh-91048: Refactor and optimize remote debugging module (#134652)
Completely refactor Modules/_remote_debugging_module.c with improved
code organization, replacing scattered reference counting and error
handling with centralized goto error paths. This cleanup improves
maintainability and reduces code duplication throughout the module while
preserving the same external API.

Implement memory page caching optimization in Python/remote_debug.h to
avoid repeated reads of the same memory regions during debugging
operations. The cache stores previously read memory pages and reuses
them for subsequent reads, significantly reducing system calls and
improving performance.

Add code object caching mechanism with a new code_object_generation
field in the interpreter state that tracks when code object caches need
invalidation. This allows efficient reuse of parsed code object metadata
and eliminates redundant processing of the same code objects across
debugging sessions.

Optimize memory operations by replacing multiple individual structure
copies with single bulk reads for the same data structures. This reduces
the number of memory operations and system calls required to gather
debugging information from the target process.

Update Makefile.pre.in to include Python/remote_debug.h in the headers
list, ensuring that changes to the remote debugging header force proper
recompilation of dependent modules and maintain build consistency across
the codebase.

Also, make the module compatible with the free threading build as an extra :)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-25 20:19:29 +00:00
..
__init__.py GH-91048: Add utils for capturing async call stack for asyncio programs and enable profiling (#124640) 2025-01-22 17:25:29 +01:00
__main__.py gh-91048: Add filename:line_no information to `asyncio pstree` (#133478) 2025-05-05 23:07:33 +00:00
base_events.py gh-128307: Support eager_start=<bool> in create_eager_task_factory and various create_task functions (#128306) 2025-05-05 04:58:07 +00:00
base_futures.py gh-84623: Remove unused imports in stdlib (#93773) 2022-06-13 16:28:41 +02:00
base_subprocess.py gh-114177: avoid calling connection lost callbacks when loop is already closed in asyncio subprocess (#134508) 2025-05-23 10:03:16 +05:30
base_tasks.py gh-97696: asyncio eager tasks factory (#102853) 2023-05-01 15:10:13 -06:00
constants.py gh-95649: Document that asyncio contains uvloop code (#107536) 2024-01-12 22:21:13 +00:00
coroutines.py gh-122858: Deprecate `asyncio.iscoroutinefunction` (#122875) 2024-08-11 16:35:51 +00:00
events.py gh-130322: drop deprecation of `asyncio.set_event_loop` (#132349) 2025-04-12 12:03:52 +05:30
exceptions.py bpo-43352: Add a Barrier object in asyncio lib (GH-24903) 2022-03-26 00:01:21 +02:00
format_helpers.py gh-112997: Don't log arguments in asyncio unless debugging (#115667) 2024-02-27 17:39:08 -08:00
futures.py gh-134173: optimize state transfer between `concurrent.futures.Future` and `asyncio.Future` (#134174) 2025-05-18 21:26:20 +05:30
graph.py gh-133893: asyncio.graph: Replace TextIO annotation with io.Writer (#133894) 2025-05-11 17:59:56 +03:00
locks.py gh-129403: Fix `ValueError` messages in `asyncio.Barrier` and `threading.Barrier` (#129419) 2025-01-30 11:11:12 +03:00
log.py
mixins.py bpo-46796: Simplify handling of removed parameter "loop" in asyncio (GH-31431) 2022-02-21 13:25:52 +02:00
proactor_events.py gh-113892: Add a extra check to `ProactorEventLoop.sock_connect` to ensure that the given socket is in non-blocking mode (#119519) 2024-06-01 09:05:19 -07:00
protocols.py bpo-46741: Update `asyncio.protocols.BufferedProtocol` docstring (31327) 2022-02-15 18:39:28 +02:00
queues.py gh-96471: Correct documentation for asyncio queue shutdown (#117621) 2024-04-08 14:50:54 +00:00
runners.py gh-130322: drop deprecation of `asyncio.set_event_loop` (#132349) 2025-04-12 12:03:52 +05:30
selector_events.py gh-90871: fix connection backlog offset in asyncio (gh-134392) 2025-05-21 15:59:09 +02:00
sslproto.py gh-118950: Fix SSLProtocol.connection_lost not being called when OSError is thrown (#118960) 2024-10-24 17:41:16 +00:00
staggered.py gh-129195: use `future_add_to_awaited_by/future_discard_from_awaited_by` in `asyncio.staggered.staggered_race` (#129253) 2025-01-26 21:14:16 +05:30
streams.py gh-117722: Fix Stream.readuntil with non-bytes buffer objects (#117723) 2024-04-11 07:41:55 -07:00
subprocess.py gh-109709: Fix asyncio test_stdin_broken_pipe() (#109710) 2023-09-22 15:29:42 +02:00
taskgroups.py gh-128307: Support eager_start=<bool> in create_eager_task_factory and various create_task functions (#128306) 2025-05-05 04:58:07 +00:00
tasks.py gh-86802: Fix asyncio memory leak; shielded task exceptions log once through the exception handler (gh-134331) 2025-05-20 17:14:27 +02:00
threads.py Trivial typo in docstring 2021-07-31 06:36:10 +02:00
timeouts.py gh-128559: Remove typing import from asyncio.timeouts (#128560) 2025-01-06 15:03:27 -08:00
tools.py gh-91048: Refactor and optimize remote debugging module (#134652) 2025-05-25 20:19:29 +00:00
transports.py gh-113812: Allow DatagramTransport.sendto to send empty data (#115199) 2024-02-16 18:38:07 -08:00
trsock.py bpo-43232: Remove previously deprecated methods on TransportSocket (GH-24538) 2021-06-30 09:19:09 +03:00
unix_events.py gh-127949: deprecate asyncio policy classes (#128216) 2024-12-24 17:30:26 +05:30
windows_events.py gh-127949: deprecate asyncio policy classes (#128216) 2024-12-24 17:30:26 +05:30
windows_utils.py asyncio: __del__() keep reference to warnings.warn (GH-11491) 2019-01-10 11:24:40 +01:00