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

Update precompile.jl #322

Merged
merged 1 commit into from
Oct 20, 2024
Merged

Update precompile.jl #322

merged 1 commit into from
Oct 20, 2024

Conversation

oheil
Copy link
Contributor

@oheil oheil commented Oct 20, 2024

fix #321

The issue are some Cairo remnants from the precompile step, called when using Luxor. I do not understand the exact details, because I don't want to delve deeper into precompile. Somehow it seems that I knew something when implementing things, because function _reset_all_drawings() exist, which, if called as last command in precompile.jl, resolves the issue.

fix JuliaGraphics#321

The issue are some Cairo remnants from the precompile step, called when using Luxor. I do not understand the exact details, because I don't want to delve deeper into precompile. Somehow it seems that I knew something when implementing things, because function _reset_all_drawings() exist, which, if called as last command in precompile.jl, resolves the issue.
Copy link

codecov bot commented Oct 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.43%. Comparing base (b8efebf) to head (2fd4712).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #322      +/-   ##
==========================================
- Coverage   73.45%   73.43%   -0.02%     
==========================================
  Files          36       36              
  Lines        6893     6893              
==========================================
- Hits         5063     5062       -1     
- Misses       1830     1831       +1     

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

@cormullion cormullion merged commit 2008087 into JuliaGraphics:master Oct 20, 2024
8 of 9 checks passed
@cormullion
Copy link
Member

Thanks! Sorry you spent a day on it 😱😂

@oheil
Copy link
Contributor Author

oheil commented Oct 20, 2024

Thanks! Sorry you spent a day on it 😱😂

No need for sorry, debugging threading issues is always fun and thrilling. Just wanted to express my effort because the solution is so meager in this case 😂

And there may be more issues in future, OP is right when saying relying on threadid is a problem, but todays experience still didn't open a better path for me. Perhaps I need to do more research on general thread techniques, my guess is, this is a well known computer science problem with a well known approach, but I don't know it yet.

@guo-yong-zhi
Copy link
Contributor

Perhaps the root problem is not the threadid but the global state variables. For example, the famous matplotlib library may also be struggling with the global state. So their explicit object-oriented style (Axes.plot) is currently more recommended for complex or non-interactive drawing instead of the convenient plt.plot one. The explicit style also has better support for multi-threading. I wish the Luxor will also have an explicit form to manage the drawing state.

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.

multithreading error: There isn't a current drawing
3 participants