Skip to content

Add thread safety#3

Merged
el-dockerr merged 3 commits intomainfrom
feature/thread-safe
Jan 31, 2026
Merged

Add thread safety#3
el-dockerr merged 3 commits intomainfrom
feature/thread-safe

Conversation

@el-dockerr
Copy link
Copy Markdown
Owner

@el-dockerr el-dockerr commented Jan 31, 2026

This pull request introduces comprehensive thread safety to the GhostMem memory manager, updates documentation and versioning to reflect this milestone, and adds a suite of multi-threaded tests to ensure correctness under concurrent usage. The changes include internal synchronization with mutexes, new threading tests, and updated documentation to advertise thread safety.

Thread safety and core implementation:

  • Added a std::recursive_mutex (mutex_) to GhostMemoryManager and protected all shared data structures and public methods with this mutex, ensuring thread-safe concurrent access and page fault handling. [1] [2] [3] [4] [5] [6] [7] [8]

Testing and build system:

  • Added tests/test_threading.cpp, a comprehensive set of multi-threaded tests covering concurrent allocations, reads/writes, page eviction, compression cycles, and random data manipulation to validate thread safety.
  • Updated CMakeLists.txt to include the new threading test and link against pthreads on non-Windows platforms.

Documentation and versioning:

  • Updated README.md to highlight thread safety, mark the feature as complete, and remove outdated claims about single-threaded operation. [1] [2] [3]
  • Bumped the project version to 0.9.0 in both README.md and Version.h, and updated version tests accordingly. [1] [2] [3]

@el-dockerr el-dockerr self-assigned this Jan 31, 2026
@el-dockerr el-dockerr merged commit 0d2485e into main Jan 31, 2026
6 checks passed
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