Skip to content

Instantly share code, notes, and snippets.

View lc0305's full-sized avatar
:shipit:

Lucas Crämer lc0305

:shipit:
  • Suttgart
View GitHub Profile
@lc0305
lc0305 / concurrentMap.ts
Last active January 27, 2023 13:55
Idiomatic TypeScript adaptation of C#'s ParallelForEachAsync
/**
* MIT License
* Copyright (c) 2022 Lucas Crämer (GitHub: lc0305)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@lc0305
lc0305 / spsc_ring.hpp
Last active November 15, 2023 16:52
Lock-Free SPSC Ring Buffer
#ifndef __SPSC_RING_H__
#define __SPSC_RING_H__
/**
* Basically Herlihy's WaitFreeQueue<T> in modern CPP
* Author: Lucas Crämer
* */
#include <array>
#include <atomic>
@lc0305
lc0305 / mpmc_ring.hpp
Last active March 14, 2021 23:02
Lock-Free MPMC Ring Buffer
#ifndef __MPMC_RING_H__
#define __MPMC_RING_H__
/**
* Inspired by 'An Interesting Lock-free Queue'
* Talk by Tony Van Eerd at the CppCon 2017:
* https://www.youtube.com/watch?v=HP2InVqgBFM
* Author: Lucas Crämer
* */