Skip to content
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

Changed time.sleep to condition.wait() #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brookman1
Copy link

@brookman1 brookman1 commented Oct 8, 2021

time.sleep(n) is a kernel call that pauses the entire Python interpreter, Python threads a virtual. Using condition.wait(n) lets the other threads execute while waiting, this bypasses the GIL (global interpreter lock).

Enabled tests to run after commit. Please say if you want me to redo the request without the tests, or ask to fix the tests if needed.

Created this pull request for leshchenko1979, https://github.com/brookman1/retry/tree/condition_wait

Thanks.

    time.sleep(n) is a kernel call that pauses the entire Python interpreter, Python threads a virtual.  Using condition.wait(n) lets the other threads execute while waiting, this bypasses the GIL (global interpreter lock).

    Added workflow to enable tests after commit.
@leshchenko1979
Copy link

Hi! This seems like an important update!

I've collected some the PRs from this repo to https://github.com/leshchenko1979/reretry.

If you could be so kind as to rebase your PR on that repo, I would gladly merge it there.

@brookman1
Copy link
Author

brookman1 commented May 17, 2022

Added pull request with removal of prints and context manager changes, added a threaded test: #54

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

Successfully merging this pull request may close these issues.

3 participants