Skip to content

chg: ⚡ optimize Future's read only method by removing useless con… #115951

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bashirmindee
Copy link

@bashirmindee bashirmindee commented Feb 26, 2024

…ditional variable usage

Optimize away Future read only method

Changes made:
remove conditional variable used in 3 methods:
1. Future.done()
2. Future.cancelled()
3. Future.running()

The usage of conditional variables here is useless because in and == operations are atomic and because these are read operations anyways. Hence this won't affect thread safety of Python code

@ghost
Copy link

ghost commented Feb 26, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Feb 26, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Feb 26, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@aisk
Copy link
Contributor

aisk commented Feb 26, 2024

I think this is not a trivial change, so it requires an issue as the devguide said.

And the PR's title should be readable (now it's split into the PR's comment).

@python-cla-bot
Copy link

The following commit authors need to sign the Contributor License Agreement:

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants