Pad PerThread when we emulate thread_local to prevent false sharing.

This commit is contained in:
Rasmus Munk Larsen 2018-08-23 12:54:33 -07:00
parent 6cedc5a9b3
commit 668690978f

View File

@ -153,6 +153,10 @@ class ThreadPoolTempl : public Eigen::ThreadPoolInterface {
ThreadPoolTempl* pool; // Parent pool, or null for normal threads.
uint64_t rand; // Random generator state.
int thread_id; // Worker thread index in pool.
#ifndef EIGEN_THREAD_LOCAL
// Prevent false sharing.
char pad_[128];
#endif
};
Environment env_;