Commit 27045b27 authored by Aaryaman Sagar's avatar Aaryaman Sagar Committed by Facebook Github Bot

Use folly::cacheline_align_v for cache alignment in thread pools

Summary:
Use folly::cacheline_align_v to prevent failures when running folly on platforms
where extended alignment is not supported.  The thread pools only used extended
alignment as an optimization; so it is safe to disable it when not needed

Reviewed By: yfeldblum

Differential Revision: D17077439

fbshipit-source-id: 63ba59aaf7ce45231bb25427af84292c3a3464a9
parent 7cfbc254
......@@ -73,8 +73,7 @@ class IOThreadPoolExecutor : public ThreadPoolExecutor, public IOExecutor {
folly::EventBaseManager* getEventBaseManager();
private:
struct alignas(hardware_destructive_interference_size) IOThread
: public Thread {
struct alignas(folly::cacheline_align_v) IOThread : public Thread {
IOThread(IOThreadPoolExecutor* pool)
: Thread(pool), shouldRun(true), pendingTasks(0) {}
std::atomic<bool> shouldRun;
......
......@@ -167,8 +167,7 @@ class ThreadPoolExecutor : public DefaultKeepAliveExecutor {
struct TaskStatsCallbackRegistry;
struct alignas(hardware_destructive_interference_size) Thread
: public ThreadHandle {
struct alignas(folly::cacheline_align_v) Thread : public ThreadHandle {
explicit Thread(ThreadPoolExecutor* pool)
: id(nextId++),
handle(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment