mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Pad PerThread when we emulate thread_local to prevent false sharing.
This commit is contained in:
@@ -153,6 +153,10 @@ class ThreadPoolTempl : public Eigen::ThreadPoolInterface {
|
|||||||
ThreadPoolTempl* pool; // Parent pool, or null for normal threads.
|
ThreadPoolTempl* pool; // Parent pool, or null for normal threads.
|
||||||
uint64_t rand; // Random generator state.
|
uint64_t rand; // Random generator state.
|
||||||
int thread_id; // Worker thread index in pool.
|
int thread_id; // Worker thread index in pool.
|
||||||
|
#ifndef EIGEN_THREAD_LOCAL
|
||||||
|
// Prevent false sharing.
|
||||||
|
char pad_[128];
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
Environment env_;
|
Environment env_;
|
||||||
|
|||||||
Reference in New Issue
Block a user