Giter Site home page Giter Site logo

tower120 / rc_event_queue Goto Github PK

View Code? Open in Web Editor NEW
20.0 3.0 0.0 626 KB

VecDeque-like fast, unbounded, mpmc/spmc concurent FIFO message queue. Lockless reads, write-lock writes.

License: Apache License 2.0

Rust 100.00%
lock-free queue fifo event-queue message-queue concurrent

rc_event_queue's People

Contributors

tower120 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rc_event_queue's Issues

Try not push if no readers

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.

isolate_readers feature

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?

Try built-in `have_next_chunk` bit into `Chunk::len_and_epoch`

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.