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

feat: Enhance Arena class for thread safety and add multithreading test #1170

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zm1060
Copy link

@zm1060 zm1060 commented Feb 16, 2024

  • Implement mutex locking in the Arena class to ensure thread-safe operations across Allocate, AllocateAligned, and related methods.
  • Refactor Arena's internal logic to prevent deadlocks and ensure efficient memory allocation in a multithreaded environment.
  • Add a comprehensive unit test in arena_test.cc to verify thread safety, focusing on concurrent memory allocation and deallocation.
  • Update documentation in arena.h to reflect new thread safety features and provide usage guidelines for multithreaded scenarios.

This commit addresses the need for thread-safe memory allocation in high-concurrency environments, improving the robustness and reliability of the Arena class in LevelDB.

- Implement mutex locking in the Arena class to ensure thread-safe operations across Allocate, AllocateAligned, and related methods.
- Refactor Arena's internal logic to prevent deadlocks and ensure efficient memory allocation in a multithreaded environment.
- Add a comprehensive unit test in arena_test.cc to verify thread safety, focusing on concurrent memory allocation and deallocation.
- Update documentation in arena.h to reflect new thread safety features and provide usage guidelines for multithreaded scenarios.

This commit addresses the need for thread-safe memory allocation in high-concurrency environments, improving the robustness and reliability of the Arena class in LevelDB.
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.

1 participant