summaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/thread_local/thread_local.h
Commit message (Collapse)AuthorAgeFilesLines
* Use generic thread-local value for kernel/groupattrs, crash context and ↵kulikov2025-11-281-12/+20
| | | | | | | | | | | | | eventlog scope - fix StdThreadLocalImpl -- make static state refcounted, there is no guarantee that static fields will outlive threads or TThreadLocalValues; - replace thread local values to generic local storage value in some places; - call runtime Init and replace local values factory; - don't disable NCurrentThreadEventlog for ytxx runtime, it should now work; - ensure generic local storage values are allocated after runtime init; - use function-scope static variables to prevent issues with order of construction and destruction; - basesearch now almost works with coroutines (with NProfile disabled). commit_hash:7fde81591b0dbc3a53b8d1cb11bb96930a2e9a80
* TThreadLocalValue over standard thread_localskulikov2025-11-251-0/+122
| | | | | | | | | | | | | | 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
* [libray/cpp/threading] Fix typosskvor2024-11-051-3/+3
| | | | commit_hash:f76f3edfa160fba90d0f8d594211fa35c6eb6077
* fix tsan warnings in library/cpp/threading unit testskulikov2024-09-121-5/+5
| | | | | | | | | - blocking_counter: fix destroy order; - thread_local: Head_.load must use std::memory_order_acquire to match memory_order_release in compare_exchange and ensure all writes are visible; also fix always null node value in first compare_exchange call; - work_stealing: use atomics. commit_hash:53f01a16bb40dd3eb890b0eb60388ecb0ce9c908
* fix ya.makemonster2022-07-071-0/+268