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

Make AsyncResult behave more like in older versions in cross-thread usage #1743

Merged
merged 5 commits into from Jan 12, 2021

Conversation

jamadden
Copy link
Member

Usage according to the documentation should be completely unchanged. Only cross-thread usage, which was never documented, should be effected.

Makes a best effort to route wakeups to the correct hub instead of hanging. In many cases, this works (actually somewhat more reliably than in older versions); in the cases it doesn't, we should at least print some exception so the user knows why their program hangs. In the best case of the "doesn't" cases, this includes an explanatory text.

The scenario laid out in #1739 is tested to work, except on PyPy, where we suffer from https://foss.heptapod.net/pypy/pypy/-/issues/3381

Required a small adaptation to semaphore.py to keep the status quo, which its own cross-thread algorithms relied on. We may be working towards some more general cross-thread primitives and support; #1742 comes out of this.

In addition to the two missing tests mentioned in test__event, I need to see if I can get a semaphore in this situation.
The background thread is problematic.
…ds_with_hub

And fix. Leave a comment about what was discovered. It's somewhat surprising.
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.

None yet

1 participant