-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Reduce _idle_semaphore calls in ThreadPoolExecutor #102024
Labels
performance
Performance or resource usage
stdlib
Python modules in the Lib dir
type-feature
A feature request or enhancement
Comments
jackcvr
changed the title
Reduce IDLE semaphore calls
Reduce IDLE semaphore calls in ThreadPoolExecutor
Feb 18, 2023
terryjreedy
changed the title
Reduce IDLE semaphore calls in ThreadPoolExecutor
Reduce _idle_semaphore calls in ThreadPoolExecutor
Feb 18, 2023
'IDLE' (capitalized) is the IDE that comes with CPython; it has nothing to do with inactivity ;-). |
gpshead
pushed a commit
that referenced
this issue
May 26, 2023
Reduced _idle_semaphore.release calls in concurrent.futures.thread._worker _idle_semaphore.release() is now only called if only work_queue is empty. --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
May 26, 2023
Reduced _idle_semaphore.release calls in concurrent.futures.thread._worker _idle_semaphore.release() is now only called if only work_queue is empty. --------- (cherry picked from commit 0242e9a) Co-authored-by: Andrii Kuzmin <jack.cvr@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
thanks! |
gpshead
pushed a commit
that referenced
this issue
May 26, 2023
…104959) gh-102024: Reduced _idle_semaphore.release calls (GH-102025) Reduced _idle_semaphore.release calls in concurrent.futures.thread._worker _idle_semaphore.release() is now only called if only work_queue is empty. --------- (cherry picked from commit 0242e9a) Co-authored-by: Andrii Kuzmin <jack.cvr@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
performance
Performance or resource usage
stdlib
Python modules in the Lib dir
type-feature
A feature request or enhancement
Feature or enhancement
In
concurrent.futures.thread.ThredPoolExecutor
methodexecutor._idle_semaphore.release()
should be called if only work queue is emptyPitch
Currently
_idle_semaphore.release()
is called after processing every item in queue. That produces useless semaphore updates in case when queue still has items to process.The optimization is going to increase processing speed of work queue.
Linked PRs
The text was updated successfully, but these errors were encountered: