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

Improve ProgressBar thread safety #212

Merged
merged 5 commits into from
Sep 2, 2024

Conversation

albertomercurio
Copy link
Member

@albertomercurio albertomercurio commented Sep 2, 2024

Description

I improved the thread safety of ProgressBar. Indeed, the previous_time variable was updated in a non-thread-safe way. I converted it into a Threads.Atomic object and then performed atomic operations on it.

Then, I also included a ReentrantLock in order to be sure that the print functions are thread-safe.

Finally, I changed the ProgressBar struct to ummutable, improving performances.

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.27%. Comparing base (d469d80) to head (e7271a3).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #212      +/-   ##
==========================================
+ Coverage   93.26%   93.27%   +0.01%     
==========================================
  Files          29       29              
  Lines        2167     2172       +5     
==========================================
+ Hits         2021     2026       +5     
  Misses        146      146              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@albertomercurio albertomercurio merged commit 791b6a5 into qutip:main Sep 2, 2024
14 checks passed
albertomercurio added a commit to lgravina1997/QuantumToolbox.jl that referenced this pull request Sep 27, 2024
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.

2 participants