A small experimental C++ library of high-performance / lock-free data structures.
This is a toy project generated using AI.
The goal is to:
- Learn AI-assisted development
- Experiment with concurrent data structures
- Explore performance-oriented C++ design
The code is not deeply reviewed and not production-ready. Expect bugs, incorrect memory ordering, and rough edges.
- Queues: SPSC, MPSC, MPMC, Disruptor-style ring buffer
- Stacks: Treiber, elimination-backoff
- Maps/Sets: skip list, read-mostly hash map
- Memory: arena, pool, slab, epoch, hazard pointers
- Sync: seqlock, MCS/CLH, ticket lock, RW spinlock, futex wrapper
- Utilities: timer wheel, sharded counter, latency histogram, work-stealing deque
- Specialized: order book, shared-memory ring buffer, zero-copy buffer
- SoC layer: basic ARM-oriented atomics, barriers, cache helpers
- Header-only
- Minimal allocations on hot paths
- Cache-aware layout
- Bounded structures where possible
- Explicit memory ordering (for learning purposes)
#include <hpl.hpp>
#include <cstdint>
#include <iostream>
int main() {
hpl::queue::spsc_queue<std::uint64_t, 1024> q;
q.push(42);
std::uint64_t v = 0;
if (q.pop(v)) {
std::cout << v << "\n";
}
}cmake -S . -B build
cmake --build build
ctest --test-dir buildSome headers include short tags:
[ALGO]— algorithm idea / invariant[MO]— memory ordering reasoning[HOT PATH]— performance-sensitive code[AI-REVIEW]— likely needs human review
These are mainly there to help reading and learning.
lib/ headers
test/ tests (unit / stress / bench)
examples/ usage examples
docs/ notes
scripts/ helper scripts
This repository exists for learning and experimentation only.
Do NOT use it in production systems.
MIT