[issue44188] ThreadPoolExecutor unbalanced semaphore count

2021-09-02 Thread Tin Tvrtković
Tin Tvrtković added the comment: I was trying to instrument one of our executors to expose some metrics, so I tried using the value of the semaphore as the number of idle threads and I noticed it was way too large. If this was fixed getting these metrics would be easier. -- nosy:

[issue44188] ThreadPoolExecutor unbalanced semaphore count

2021-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: To be clear, this probably doesn't have any actual consequence, since the right number of threads is launched anyway (at least in the example). But it's probably worth making the implementation less quirky (also, the semaphore's internal counter *might*

[issue44188] ThreadPoolExecutor unbalanced semaphore count

2021-08-31 Thread Antoine Pitrou
Change by Antoine Pitrou : -- versions: +Python 3.11 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue44188] ThreadPoolExecutor unbalanced semaphore count

2021-05-20 Thread Bennie Swart
Change by Bennie Swart : -- keywords: +patch pull_requests: +24869 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26265 ___ Python tracker ___

[issue44188] ThreadPoolExecutor unbalanced semaphore count

2021-05-20 Thread Bennie Swart
New submission from Bennie Swart : The concurrent.futures.ThreadPoolExecutor class, which is the default asyncio executor, introduced the _idle_semaphore field in version 3.8 in order to track idle threads so they can be reused before increasing the pool size unnecessarily. This semaphore