This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __SPSC_RING_H__ | |
#define __SPSC_RING_H__ | |
/** | |
* Basically Herlihy's WaitFreeQueue<T> in modern CPP | |
* Author: Lucas Crämer | |
* */ | |
#include <array> | |
#include <atomic> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 | |
* */ |