GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Reduce _idle_semaphore calls in ThreadPoolExecutor · Issue #102024 · python/cpython

Reduce _idle_semaphore calls in ThreadPoolExecutor #102024

New issue
Copy link
New issue
Copy link
Closed
Closed
Reduce _idle_semaphore calls in ThreadPoolExecutor#102024
Copy link
Labels
performancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

@jackcvr
jackcvr
opened on Feb 18, 2023
Issue body actions

Feature or enhancement

In concurrent.futures.thread.ThredPoolExecutor method executor._idle_semaphore.release() should be called if only work queue is empty

Pitch

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

  • gh-102024: Reduced _idle_semaphore.release calls #102025
  • [3.12] gh-102024: Reduced _idle_semaphore.release calls (GH-102025) #104959

Activity

  1. jackcvr
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Feb 18, 2023
  2. arhadthedev
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Feb 18, 2023
  3. arhadthedev
    added this to Threading issues 🧵on Feb 18, 2023
  4. jackcvr
    changed the title [-]Reduce IDLE semaphore calls[/-] [+]Reduce IDLE semaphore calls in ThreadPoolExecutor[/+] on Feb 18, 2023
  5. terryjreedy
    changed the title [-]Reduce IDLE semaphore calls in ThreadPoolExecutor[/-] [+]Reduce _idle_semaphore calls in ThreadPoolExecutor[/+] on Feb 18, 2023
  6. terryjreedy commented on Feb 18, 2023

    @terryjreedy
    terryjreedy
    on Feb 18, 2023
    Member
    More actions

    'IDLE' (capitalized) is the IDE that comes with CPython; it has nothing to do with inactivity ;-).

  7. gpshead
    added a commit that references this issue on May 26, 2023

    gh-102024: Reduced _idle_semaphore.release calls (#102025)

    0242e9a
  8. miss-islington
    added a commit that references this issue on May 26, 2023

    pythongh-102024: Reduced _idle_semaphore.release calls (pythonGH-102025)

    48d7818
  9. gpshead
    added
    performancePerformance or resource usagePerformance or resource usage
    on May 26, 2023
  10. gpshead commented on May 26, 2023

    @gpshead
    gpshead
    on May 26, 2023
    Member
    More actions

    thanks!

  11. gpshead
    closed this as completedon May 26, 2023
  12. github-project-automation
    moved this to Done in Threading issues 🧵on May 26, 2023
  13. gpshead
    added a commit that references this issue on May 26, 2023

    [3.12] gh-102024: Reduced _idle_semaphore.release calls (GH-102025) (#…

    8010cef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

    Projects

    • Threading issues 🧵
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.