Skip to content

Instantly share code, notes, and snippets.

@pfirsich
pfirsich / mpsc_queue.cpp
Last active April 26, 2022 10:59
Dmitry Vyukov's thread-safe multiple producer single consumer queue with wait free production ported to C++. I read the source code carefully and added lots of comments explaining what it does (it took me a while to figure it all out).
// g++ -Wall -Wextra -O0 -g -o log_test
#include <atomic>
#include <optional>
// Vyukov MPSC (wait-free multiple producers, single consumer) queue
// https://www.1024cores.net/home/lock-free-algorithms/queues/intrusive-mpsc-node-based-queue
template <typename T>
class MpscQueue {
public:
#pragma once
#include <string>
#include <spdlog/spdlog.h>
template <typename Derived>
struct DebugLogging {
DebugLogging() { spdlog::info("{} constructed", debugId()); }
@pfirsich
pfirsich / physfs_io.cpp
Created May 17, 2023 17:41
An example of a C++ wrapper for `PHYSFS_Io`
#include <cstdio>
#include <fmt/format.h>
#include <physfs.h>
template <typename Derived>
struct PhysfsIo : PHYSFS_Io {
protected:
PhysfsIo()
: PHYSFS_Io {
@pfirsich
pfirsich / proton_sysinfo_kynes.txt
Last active March 9, 2025 10:42
Proton System Information - kynes
to be modified
@pfirsich
pfirsich / proton_sysinfo_seldon.txt
Created March 9, 2025 10:58
Proton System Information - seldon
===== SYSTEM INFORMATION FOR PROTON BUG REPORT =====
Date: Sun Mar 9 11:57:30 AM CET 2025
GPU:
Intel Corporation UHD Graphics 620 (rev 07)
NVIDIA Corporation GP108M [GeForce MX150] (rev a1)
NVIDIA Driver Version: 565.77
OS: Pop!_OS 22.04 LTS
Kernel: 6.9.3-76060903-generic