Skip to content

Commit

Permalink
dummy size in TLS change from page size to cache line size
Browse files Browse the repository at this point in the history
  • Loading branch information
mkornaukhov03 committed Nov 20, 2023
1 parent 7052bca commit dcdd225
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/threading/tls.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ inline uint32_t get_default_threads_count() noexcept {
template<class T>
struct TLS {
private:
static constexpr std::size_t PAGE_SIZE = 4096;
static constexpr std::size_t CACHE_LINE_SIZE = 64;
struct TLSRaw {
T data{};
volatile int locker = 0;
char dummy[4096];
char dummy[CACHE_LINE_SIZE];
};

TLSRaw arr[MAX_THREADS_COUNT + 1];
Expand Down

0 comments on commit dcdd225

Please sign in to comment.