Skip to content

Commit

Permalink
Simplify futures
Browse files Browse the repository at this point in the history
  • Loading branch information
ppigazzini committed Jan 9, 2025
1 parent f5c9deb commit f28985c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions worker/games.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import concurrent.futures
import copy
import ctypes
import hashlib
Expand All @@ -18,6 +17,7 @@
import threading
import time
from base64 import b64decode
from concurrent.futures import ProcessPoolExecutor
from datetime import datetime, timedelta, timezone
from pathlib import Path
from queue import Empty, Queue
Expand Down Expand Up @@ -435,13 +435,8 @@ def verify_signature(engine, signature, active_cores):
)
)

with concurrent.futures.ProcessPoolExecutor(max_workers=active_cores) as executor:
futures = [
executor.submit(run_single_bench, engine) for _ in range(active_cores)
]
results = [
future.result() for future in concurrent.futures.as_completed(futures)
]
with ProcessPoolExecutor(max_workers=active_cores) as executor:
results = list(executor.map(run_single_bench, [engine] * active_cores))

bench_nps = 0.0

Expand Down
2 changes: 1 addition & 1 deletion worker/sri.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"__version": 247, "updater.py": "Mg+pWOgGA0gSo2TuXuuLCWLzwGwH91rsW1W3ixg3jYauHQpRMtNdGnCfuD1GqOhV", "worker.py": "fnKb7BjtNafSyeNEDD4R8km3YFzO0SvQHVdn252B3lDsV2wxLr3mG6SxqCVw8Sqg", "games.py": "gzokk+Sghkt4JXG8cyz9nADt3hRObZNn2DazCJOOjRtOTDvldcp5r0ek0zlsAarT"}
{"__version": 247, "updater.py": "Mg+pWOgGA0gSo2TuXuuLCWLzwGwH91rsW1W3ixg3jYauHQpRMtNdGnCfuD1GqOhV", "worker.py": "fnKb7BjtNafSyeNEDD4R8km3YFzO0SvQHVdn252B3lDsV2wxLr3mG6SxqCVw8Sqg", "games.py": "8aK1JFbnWn5KKEgAHyiyw1gG1PkOjXAWm7CKZUIgNFlbdkekfpN8+32o5UpupttW"}

0 comments on commit f28985c

Please sign in to comment.