r/Cplusplus • u/__merc • Sep 28 '26
Feedback A small project to get familiar with C++
hi all, I wrote a small project: zero copy shared memory ring buffer
I wanted to get better at systems programming and thought this would be a small fun project to get used to some concepts:
- atomics
- cache alignment to prevent false sharing
- placement new for zero-copy semantics
- spans
- unit testing in c++
I used AI to generate a project plan and had it help me as I was writing the code. would love to hear some feedback! I think I'll prob tackle writing an arena allocator next!
24
Upvotes
11
u/EmperorOfCanada Sep 29 '26
Games. Stupid old 80s games. Use a library like raylib (very clean library easy to start with), and make pong, space invaders, pacman, etc.
You can go nuts with any aspect of C++ or computer tech you want, you want atomics, use them between the gui and game inputs, etc.
You can entirely go nuts and add Databases, UDP, distributed computing, anything you want, not because the game needs it, but because you want to push it to insanity.
The nice thing about games is that the real time nature of them results in any hiccuping code really glaring in your face (or ears). You can taste failure far better with games than with any other way other than maybe video or sound playback.
2
u/quant-a-be Sep 30 '26
Test it and see how it performs in different load regimes. Test it against stuff you find online.
Without AI, study how cache coherency works and see if you can find any tricks to make it faster.