r/cpp • • Mar 24 '26

Optimizing a Lock-Free Ring Buffer

https://david.alvarezrosa.com/posts/optimizing-a-lock-free-ring-buffer/
106 Upvotes

58 comments sorted by

View all comments

Show parent comment

3

u/[deleted] Mar 24 '26

[removed] — view removed comment

1

u/david-alvarez-rosa Mar 24 '26

Oh I see. That's quite specific, not sure which is your usecase

1

u/ack_error Mar 25 '26

I don't see why memcpy() would be a problem, since that's in userspace. No fault would occur since there would be a valid address mapping, it just happens to alias the same physical memory or backing storage as 64KB back in virtual address space.

System calls are more interesting as the kernel would be accessing the memory. I suspect it'd also be fine, but there are less guarantees in that case.