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 lz4f optimization thread unsafe #9714

Closed
wants to merge 4 commits into from

Conversation

xiaokang
Copy link
Contributor

Proposed changes

Issue Number: close #9706 , which was introduced by #9566

Make reusing compress/decompress context object thread safe by using thread_local.

Problem Summary:

Describe the overview of changes.

Checklist(Required)

  1. Does it affect the original behavior: (No)
  2. Has unit tests been added: (No Need)
  3. Has document been added or modified: (No Need)
  4. Does it need to update dependencies: (No)
  5. Are there any changes that cannot be rolled back: (No)

@xiaokang
Copy link
Contributor Author

The thread_local approach is learned from #7911 by @xinyiZzz . It will be very appreciated if you have a look and check whether the usage of thread_local in this pr is right, @xinyiZzz .

@xinyiZzz
Copy link
Contributor

The thread_local approach is learned from #7911 by @xinyiZzz . It will be very appreciated if you have a look and check whether the usage of thread_local in this pr is right, @xinyiZzz .

Sorry I just saw it, I see you have submitted a better solution to replace this pr.

There is no problem with using thread_local, but I suggest adding thread local variables to the ThreadContext class. in the future.

@xiaokang
Copy link
Contributor Author

@xinyiZzz , thank you for your suggestion and it's valuable. Yes, a better solution #9741, so this one will be closed.

@xiaokang xiaokang closed this May 24, 2022
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.

[Bug] double free on lz4
2 participants