CVB Buffers Memory Shared? Inter-Process access?

A general question from another CVB user.

"Are the buffers which are allocated in the CVB driver dll (SharedImg ??) shared memory or not.

In case not, is it possible to change it to shared memory.*

The idea is to receive pointers to the images that were captured in the Stemmer Dll and to access them directly in inter-process manner."

2 Likes

Hi @Dr.Slump

Buffers allocated by :cvb: drivers are usually not located in shared memory. While shared memory is convenient for accessing the same driver/image data from within different processed, it has the significant drawback that access to shared memory is usually a lot slower than access the process-local memory. Therefore :cvb:'s drivers do not use shared memory to store their data in, as this would significantly reduce performance.

In theory it should be possible to have at least some drivers use shared memory (it’s not possible for all of them - some of the *.vin drivers of :cvb: rely on a vendor SDK underneath them to allocate the memory for them), but that open immediately raises the issues of who (which process) should control the acquisition, how other processes get the information where the image data resides in memory and which of them is the most up-to-date one and how the protocol for communicating continued use of the shared memory is to be handled (you’d need some sort of inter-process-reference-counting as well).

3 Likes

Ok. Thanks for the answer!