tower120 / rc_event_queue Goto Github PK
View Code? Open in Web Editor NEWVecDeque-like fast, unbounded, mpmc/spmc concurent FIFO message queue. Lockless reads, write-lock writes.
License: Apache License 2.0
VecDeque-like fast, unbounded, mpmc/spmc concurent FIFO message queue. Lockless reads, write-lock writes.
License: Apache License 2.0
also update truncate_front
But is that needed?
Construct EventReader with new()
instead of EventQueue::subscribe
Try check readers_count in push/extend, instead of
if S::AUTO_CLEANUP {
if self.readers.load(Ordering::Relaxed) == 0{
self.cleanup_impl(&mut list);
}
}
in clear/truncate/resize
Do that after spmc implementation.
Benchmark.
Have readers_count in each chunk. On Subscribe/unsubscribe +/-1 read_completely_times only on last chunk.
Implement spmc through dummy lock + EventQueue mut interfaces.
somewhat like truncate_front but for readers.
encode in ChunkState special code for reader to switch to isolator_chunk (size=0, always return None).
Also change Event to null, and decrease EventQueue reader count (have special unsubscribe?).
Have separate isolated_list_first in EventQueue?
Instead of testing
let next_chunk = chunk.next().load(Ordering::Acquire);
if next_chunk == null_mut(){
return None;
}
if chunk.len_and_epoch(Ordering::Acquire).len() as usize != self.chunk_len{
return None;
}
in EventReader. Store have_next_chunk bit in atomic Chunk::len_and_epoch
"bitarray". if at current len there is next chunk - it is safe to switch.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.