Skip to content

Reduce _idle_semaphore calls in ThreadPoolExecutor #102024

Closed
@jackcvr

Description

@jackcvr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance or resource usagestdlibPython modules in the Lib dirtype-featureA feature request or enhancement

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions