2 ms·
You can specify the memory ordering of operations to get the desired fences. For an spsc queue just load aquires and store releases are sufficient and will hav
by gpderetta 10y ago
You can specify the memory ordering of operations to get the desired fences.
For an spsc queue just load aquires and store releases are sufficient and will have no overhead at all on x86.
Don't use operator++ to increment ( it will use an expensive lock xadd) just code the explicit load + add + store sequence. It is safe on this specific case.