Skip to content

Commit

Permalink
Ensure CACHE_LINE_SIZE does not clash with any project level macros b…
Browse files Browse the repository at this point in the history
…y prefixing with ENKI_
  • Loading branch information
dougbinks committed Oct 28, 2019
1 parent aae917a commit 7188cab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/TaskScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace enki
static const uint32_t SPIN_COUNT = 10;
static const uint32_t SPIN_BACKOFF_MULTIPLIER = 100;
static const uint32_t MAX_NUM_INITIAL_PARTITIONS = 8;
static const uint32_t CACHE_LINE_SIZE = 64; // awaiting std::hardware_constructive_interference_size
static const uint32_t ENKI_CACHE_LINE_SIZE = 64; // awaiting std::hardware_constructive_interference_size
};

// thread_local not well supported yet by C++11 compilers.
Expand Down Expand Up @@ -84,9 +84,9 @@ namespace enki
struct ThreadDataStore
{
std::atomic<ThreadState> threadState;
char prevent_false_Share[ enki::CACHE_LINE_SIZE - sizeof(std::atomic<ThreadState>) ];
char prevent_false_Share[ enki::ENKI_CACHE_LINE_SIZE - sizeof(std::atomic<ThreadState>) ];
};
static_assert( sizeof( ThreadDataStore ) >= enki::CACHE_LINE_SIZE, "ThreadDataStore may exhibit false sharing" );
static_assert( sizeof( ThreadDataStore ) >= enki::ENKI_CACHE_LINE_SIZE, "ThreadDataStore may exhibit false sharing" );

class PinnedTaskList : public LocklessMultiWriteIntrusiveList<IPinnedTask> {};

Expand Down

0 comments on commit 7188cab

Please sign in to comment.