Skip to content

Instantly share code, notes, and snippets.

@ed-aka-yaboi
ed-aka-yaboi / .md
Created March 23, 2026 16:31
lockfree knowledge check
  1. How is the following code broken?
  2. Why does it work on x86? Why not on arm?
#include "relacy/context.hpp"
#include "relacy/memory_order.hpp"
#include <relacy/relacy.hpp>

static constexpr size_t THREADS = 2;
static constexpr int ITERS = 4;
@ed-aka-yaboi
ed-aka-yaboi / shell.nix
Last active November 10, 2024 20:07
Incremental python shell.nix (assumes a local install of nix-ld if using NixOS)
with import <nixpkgs> { };
let
venvDir = "./.venv";
pythonPackages = python310Packages;
NIX_LD_LIBRARY_PATH = lib.makeLibraryPath [
stdenv.cc.cc
openssl
];
@ed-aka-yaboi
ed-aka-yaboi / sort-magic-cookie.sh
Created July 22, 2021 20:43
sets magic cookie for current value of $DISPLAY