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

Fix deadlock in parallel mode #524

Merged
merged 1 commit into from
Jun 25, 2023
Merged

Conversation

andrews05
Copy link
Collaborator

When oxipng is run within an existing rayon context, there may not be any spare threads to execute the evaluations, causing a deadlock. This change adds a yield loop so that the main thread can execute the evaluations when necessary.
Fixes #517

@Pr0methean
Copy link
Contributor

When I tested this in Pr0methean/OcHd-RustBuild@7f2f5f3 (which was also using #524 and zopfli-rs/zopfli#21), I got a stack overflow on 64x64 images.

@andrews05
Copy link
Collaborator Author

Oh, I thought you said it was working? Or is just specific sizes that do/don't work?

@Pr0methean
Copy link
Contributor

Pr0methean commented Jun 24, 2023

It seems to depend in a weird way on the version of the zopfli crate I'm using.

@andrews05
Copy link
Collaborator Author

I suspect it may not be an issue with oxipng. You may have to debug that one yourself.

@shssoichiro shssoichiro merged commit 129f1e6 into shssoichiro:master Jun 25, 2023
@andrews05 andrews05 deleted the parallel branch June 25, 2023 18:51
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.

Parallel mode hangs when invoked from Rayon global thread pool
3 participants