rigtorp / MPMCQueue

A bounded multi-producer multi-consumer concurrent queue written in C++11
MIT License
1.18k stars 160 forks source link

static assertion failed #45

Open ZwjAccount opened 10 months ago

ZwjAccount commented 10 months ago

I created a queue of global variables, but an error occurred during compilation. Slot must be aligned to cache line boundary to prevent false sharing. 141 | alignof(Slot) == hardwareInterferenceSize, The way to create a queue is as follows: MPMCQueue<HqOpsStoreMessage> snap_mpmc_queue(MPMCBUF_SIZE); How to solve this problem?

brmarkus commented 10 months ago

Can you share more of your code - a small reproducable section of code, please?

ZwjAccount commented 10 months ago

How about tomorrow? I just found the #program once directive in another third-party library I use. I'll move on to see if it's causing the impact, and if not, I'm giving you some more of my code.

---- Replied Message ---- | From | Markus @.> | | Date | 11/20/2023 19:44 | | To | rigtorp/MPMCQueue @.> | | Cc | ZwjAccount @.>, Author @.> | | Subject | Re: [rigtorp/MPMCQueue] static assertion failed (Issue #45) |

Can you share more of your code - a small reproducable section of code, please?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>