Comments (1)
Overwiriting insert is wanted function especially in atomic context. Probably as separate function instead of overloading. I'll definitely add it in mpmc, but non atomic overloads of insert is going to be a lot of burden now.
It is still possible to inherit from the spsc class and add followinfg function
//non atomic, returns true if overwritten
bool insertOverwrite(T data)
{
if(!insert(data)) {
remove();
insert(data);
return true;
}
return false;
}
not the most efficient, but should work.
from ring-buffer.
Related Issues (20)
- isnt std::atomic_thread_fence more appropriate ? HOT 1
- Generalize ring buffer, differentiate between atomic ring buffer non-atomic ring buffer HOT 1
- const consumerClear producerClear compile errors HOT 1
- unncessary void in parameter list HOT 1
- alignas(0) causes gcc warnings
- Multiple producers, a single consumer situation will produce a crash HOT 1
- How to use for multi-consumer multi-producer HOT 1
- Add way to remove arbitrary element HOT 1
- Implement iterator
- sometimes stuck on isempty function and cache padding HOT 11
- Does this ringbuffer thread safe? HOT 2
- Add find function HOT 1
- èŠć C26495 HOT 4
- add support for non trivial objects HOT 9
- readBuff(T*, size_t) never actually reads HOT 1
- "no wasted slots" is only true if you need power of 2 size
- There is a compiling error in Visual Studio 2015 on Windows 7 HOT 1
- As in the description, this is for embedded targents, can I use it for x86 PC? HOT 1
- peek() is not right
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â€ïž Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ring-buffer.