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

[Python] Use thread-safe futures for concurrent operations #33891

Merged

Commits on Jun 13, 2024

  1. [Python] Use thread-safe futures for concurrent operations

    Instead of using quasi-global variables in the ChipStack singleton
    use device controller local futures to store results from callbacks.
    This has several advantages, namely:
    - Avoid unnecessary shared state between device controllers
    - Avoid unnecessary shared state between various operations within a
      device controller (those who don't share callbacks could be called
      from different threads now)
    - Explicitly set Futures to None to detect spurious/unexpected callbacks
    - Better code readability
    - concurrent.futures are thread-safe
    - Will make asyncio transition easier
    
    This change shouldn't change the external API.
    agners committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    80db303 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    aa4a78a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3c24956 View commit details
    Browse the repository at this point in the history