Buffer Interprocess Sharing: BIPS Basics

From RidgeRun Developer Wiki


  Index Next: Getting Started






Foundations

RidgeRun Buffer Interprocess Sharing (BIPS) is a library conceived to exchange buffers between processes, allowing exchanging buffers between C++ and Python applications, and among different containers. The key features of BIPS are:

  • Keeps synchronization between producers and consumers
  • Works with both C++ and Python
  • Interlanguage (C++ and Python) intercommunication
  • Docker containers intercommunication capability
  • Python NumPy buffers complaint
  • Compatible with the most popular Deep Learning frameworks: TensorFlow and PyTorch
  • Multiple consumers capability (buffer broadcasting)
  • Zero memory copy buffer exchange with a high exchange rate

The foundations of BIPS consist in having a producer process, which fills buffers with valid data, and one or more consumer processes, that receive the buffers and consume their contents.

BIPS Foundations
BIPS Foundations

Either the producers or the consumers can be in either C++ or Python.

Philosophy

RidgeRun Buffer Interprocess Sharing aims to be as simple as pulling and pushing a buffer, freeing the user from the complexity of synchronizing processes and handling concurrency hazards. Pulling a buffer implies requesting a buffer to fill / read data, and pushing implies returning the buffer for reading / or writing.

To illustrate this principle, please, see the following example:

import bips

producer = bips.Producer(bips.Backends.kShm, '/example', 10, 1024, True)

buffer = producer.Pull()
# Do processing
producer.Push(buffer)

same for the consumer:

import bips

consumer = bips.Consumer(bips.Backends.kShm, '/example', 10, 1024, True)

buffer = consumer.Pull()
# Do processing
consumer.Push(buffer)



  Index Next: Getting Started