Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atomic refactor for lock-free ringbuffer [Foxy] #302

Commits on Mar 6, 2024

  1. fix: Use atomic variables to maintain thread-safe data access without…

    … locks, port unique_lock creation into constructor and only perform lock/unlock operations in callbacks.
    
    * Both blocking read and write callbacks continue to rely on condition variables for data availability.
    * The write_overwrite callback now relies only on the atomic operations without locks, and does not push the read index if overwriting.
    * The read_timeout callback will simply not perform the callback instead of returning a nullptr.
    * Implemented true nonblocking read_nonblock and write_nonblock callbacks, which rely only on the atomic operations and return immediately either performing or not performing the callback.
    Imaniac230 committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    1c03d79 View commit details
    Browse the repository at this point in the history
  2. feat: Adjust and implement new tests for the lock-free ringbuffer imp…

    …lementation.
    
    * Adjusted current tests for the lock-free behavior.
    * Added tests for the non-blocking implementation.
    * Implemented new tests for scenarios, where one thread always runs slower than the other.
    Imaniac230 committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    ed06e57 View commit details
    Browse the repository at this point in the history
  3. fix: Use the stable packet data copy for callback processing in Ouste…

    …rDriver as well.
    
    * Utilizing the PacketMsg data structure to have the pointed-to buffer data transferred immediately once received and use the stable copy for further processing, instead of a reference to potentially mutable underlying data.
    Imaniac230 committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    455aff2 View commit details
    Browse the repository at this point in the history