Prevent L1 cache line evicion in MPMC queue

This reduces cache coherence overhead of the queue
This commit is contained in:
Robin Gareus 2021-06-07 05:17:38 +02:00
parent 4484b60b13
commit 1eb6b82b9f
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -137,11 +137,16 @@ private:
T _data;
};
cell_t* _buffer;
size_t _buffer_mask;
typedef char cacheline_pad_t [64];
cacheline_pad_t _pad0;
cell_t* _buffer;
size_t _buffer_mask;
cacheline_pad_t _pad1;
GATOMIC_QUAL gint _enqueue_pos;
cacheline_pad_t _pad2;
GATOMIC_QUAL gint _dequeue_pos;
cacheline_pad_t _pad3;
};
} /* end namespace */