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 sure we don't multithread libzip access #16680

Merged
merged 2 commits into from
Dec 31, 2022

Conversation

unknownbrackets
Copy link
Collaborator

@unknownbrackets unknownbrackets commented Dec 31, 2022

Since it uses a shared fd, of course we can't allow it to be used from two threads at once. I suspect this is the cause of #16642 and it could even be one of the mysteries in #16601.

Could use a bit more thorough testing, though. I didn't really try to replicate #16642 and more made sure it still loads textures.

I thought about opening multiple zips per thread, but because of our bestest friend scoped storage, I suspect that would be slower than just locking during the zip read. We still png/zim decode concurrently.

-[Unknown]

We can't have two threads seeking on the same fd at the same time.
We can't read multiple at once.
@hrydgard hrydgard added this to the v1.14.3 milestone Dec 31, 2022
@hrydgard
Copy link
Owner

Wow, this seems quite obvious now... But just didn't think about it, heh.

@hrydgard hrydgard merged commit 25cf61f into hrydgard:master Dec 31, 2022
@unknownbrackets unknownbrackets deleted the zip-thread branch December 31, 2022 07:39
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