Efficient per-object thread-local storage library

I am not satisfied with the existing per-object tls library, so I made this.

The following is quoted from README

Efficient per-object thread-local storage implementation.

Unlike thread_local crate, it can release objects normally at the end of thread,
and will not move objects between multiple threads.

Unlike os-thread-local crate, it only uses the std::thread_local! abstraction of rust standard library,
and does not use any other platform-related APIs.
This means that its capacity is not limited by PTHREAD_KEYS_MAX.

And its performance is relatively good,
value access for less than 64 threads is completely lock-free, and has O(1) time complexity.
But since we store thread id in std::thread_local!, so we will be slightly slower than std::thread_local!.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.