Buffer Interprocess Sharing - v0.1.0

From RidgeRun Developer Wiki



  Index Next: BIPS Basics



Buffer Interprocess Sharing!

Buffer Interprocess Sharing.





Buffer Interprocess Sharing

This wiki is a user guide for our Buffer Interprocess Sharing project.

What is Buffer Interprocess Sharing?

Buffer Interprocess Sharing, or BIPS, is RidgeRun's optimized IPC library fully compatible with C++ and Python. In this case, BIPS allows sharing of data buffers between two or more processes with zero copy. They can be classified as Producers or Consumers according to their role in the system. The producer is responsible for generating and filling in the information on the buffers that the Consumers will read. The synchronization between these entities is handled by the Signaler, which ensures that all operations are concurrent-safe. This means that Consumers can only read buffers that are fully written by Producers and that Producers can only write buffers already read by Producers. These buffers are created and managed by a shared structure known as the Buffer Pool, which has a fixed capacity. The Signaler handles the synchronization between the BP and the Consumers/Producers.




BIPS communication between two processes
BIPS communication between two processes




BIPS communication betwen one Producer and N Consumers
BIPS communication betwen one Producer and N Consumers




Use cases

Wondering how and when to use BIPS?

BIPS is a solution to exchange memory buffers between two isolated processes with zero copies without requiring additional processes. You can find BIPS in the following use cases:

  • Buffer exchange between C++ and Python

BIPS allows communication between C++ and Python back and forth. A particular case is using a GStreamer capture application that requires transmitting the frames captured by a camera to a PyTorch-based Python application. From C++, you can define an agnostic memory buffer to submit it through BIPS and receive it by a Python application using the Buffer Protocol. Python can handle these buffers in an agnostic fashion or cast them to NumPy straight-forward without any memory copy.


BIPS communication between one Producer and N Consumers
BIPS communication between one Producer and N Consumers


  • Buffer exchange between applications in containers

BIPS allows zero-copy communication between applications isolated through containers. This makes BIPS a friend in your applications based on microservices without requiring any other container or process for the data exchange.

BIPS communication between one Producer and N Consumers in containers
BIPS communication between one Producer and N Consumers in containers

TensorFlow, the TensorFlow logo, and any related marks are trademarks of Google Inc. PyTorch, the PyTorch logo and any related marks are trademarks of The Linux Foundation. SciPy is developed in the open on GitHub, through the consensus of the SciPy and wider scientific Python community. The Python logo is a trademark of the Python Software Foundation

For testing purposes, RidgeRun offers an evaluation version. Please refer to Contact Us.

Supported Backends

BIPS is used to communicate processes that need to share information, which helps optimize memory usage and application performance. BIPS supports:

  • Shared Memory
  • NVIDIA NvSciIPC (under development)

The backend is responsible for allocating the pool of buffers with a fixed size, which will be known before processing. This is to avoid expensive allocation and free operations at runtime and to avoid memory fragmentation. Shared Memory is a standard way to communicate data between processes (IPC - Inter Process Communication, see the diagram below). In this methodology, data is allocated in a commonplace. So, when any process updates some value in the shared zone, the other processes can see the updated value immediately. BIPS shared memory implementation is based on the POSIX Shared Memory (shm) to offer great compatibility.


Flow Diagram.
Flow Diagram.



Tested Platforms

Since BIPS is based on POSIX, it is compatible with POSIX-complaint systems. We have tested it on:

  • x86-64 (Linux)
    • Intel-based systems
    • AMD-based systems
  • ARM 64-bit (Linux)
    • NVIDIA Jetson Nano
    • NVIDIA Jetson Xavier
    • NVIDIA Jetson Orin
    • NVIDIA Jetson TX2

                                                                           


RidgeRun Support

RidgeRun provides support for embedded Linux development for NVIDIA, Xilinx, Freescale/NXP, and Texas Instruments platforms, specializing in multimedia applications. This page contains detailed guides and information on how to get started with Buffer Interprocess Sharing and start using its full capabilities.

To get up-to-speed with your Buffer Interprocess Sharing, start by clicking below:



RidgeRun Resources

Quick Start Client Engagement Process RidgeRun Blog Homepage
Technical and Sales Support RidgeRun Online Store RidgeRun Videos Contact Us
RidgeRun.ai: Artificial Intelligence | Generative AI | Machine Learning

Contact Us

Visit our Main Website for the RidgeRun Products and Online Store. RidgeRun Engineering informations are available in RidgeRun Professional Services, RidgeRun Subscription Model and Client Engagement Process wiki pages. Please email to support@ridgerun.com for technical questions and contactus@ridgerun.com for other queries. Contact details for sponsoring the RidgeRun GStreamer projects are available in Sponsor Projects page.


  Index Next: BIPS Basics