diff options
| author | kulikov <[email protected]> | 2025-11-25 01:07:59 +0300 |
|---|---|---|
| committer | kulikov <[email protected]> | 2025-11-25 01:25:22 +0300 |
| commit | f688bd5f5a6b127269d329a997ff5945cbcd5d87 (patch) | |
| tree | 15564ded86e7d8f8a8f2b59055cca0269d6984ee /library/cpp/threading/queue/queue_ut.cpp | |
| parent | 7af73a3de3b9a9faa4a8654f5a2b62adf21dded5 (diff) | |
TThreadLocalValue over standard thread_locals
Current TThreadLocal implementation doesn't destroy objects on thread exit (so we can't replace thread\_local tls value with it, and with TGenericLocalValue too), standard thread\_local values can't be class members. So try to reimplement TThreadLocalValue:
- instead of adressing by thread id, address objects by uniq object id in thread\_local deque of all objects of current type;
- use hashmap of all existing perthread deques to destroy objects with their TThreadLocal;
- try to make object ids flat;
- no complex lookup inside and no contention between tls.Get calls;
- ShortLivedThreads ut now works;
- some fixes in Trace ut, make threads outlive tls value;
- benchmark results <https://nda.ya.ru/t/agWa9PW67NYAAK>, looks better than all others;
- probably should switch to this implementation by default and remove old.
commit_hash:262ce4d363751f577373a452a0c2c84d1fe5b79c
Diffstat (limited to 'library/cpp/threading/queue/queue_ut.cpp')
0 files changed, 0 insertions, 0 deletions
