Skip to content

Commit

Permalink
#grain Fix issue with running over 50 subprocesses.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 714064248
  • Loading branch information
aaudiber authored and copybara-github committed Jan 10, 2025
1 parent 32d62b5 commit 7e5e547
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions grain/_src/python/shared_memory_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,7 @@ def enable_async_del(
"""
with SharedMemoryArray._lock:
if not SharedMemoryArray._del_thread_pool:
if max_outstanding_requests < num_threads:
raise ValueError(
"max_outstanding_requests must be at least num_threads."
)
max_outstanding_requests = max(max_outstanding_requests, num_threads)
SharedMemoryArray._del_thread_pool = pool.ThreadPool(num_threads)
SharedMemoryArray._outstanding_del_requests = threading.Semaphore(
max_outstanding_requests
Expand Down

0 comments on commit 7e5e547

Please sign in to comment.