Skip to content

gh-91048: Fix external inspection multi-threaded performance #136005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 28, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FIx race
  • Loading branch information
pablogsal committed Jun 27, 2025
commit 03f447e57eb43ba69c4675ea00aaa03e81c5b97d
7 changes: 5 additions & 2 deletions Lib/test/test_external_inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,11 +901,13 @@ def worker_thread(name, barrier, ready_event):

def main_work():
# Do busy work to hold the GIL
sock.sendall(b"working\\n")
count = 0
while count < 100000000:
count += 1
if count % 10000000 == 0:
pass # Keep main thread busy
sock.sendall(b"done\\n")

# Create synchronization primitives
num_threads = 3
Expand Down Expand Up @@ -959,8 +961,9 @@ def main_work():
while b"ready" not in response:
response += client_socket.recv(1024)

# Give threads a moment to start their busy work
time.sleep(0.1)
# Wait for the main thread to start its busy work
while b"working" not in response:
response += client_socket.recv(1024)

# Get stack trace with all threads
unwinder_all = RemoteUnwinder(p.pid, all_threads=True)
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy