Is it safe to concurrently open multiple cameras?

Greetings,

I have a query regarding the Cvb::DeviceFactory::Open() function. I have both an area scan and a line scan camera. My goal is to open the area scan camera for Vin Acquisition and the line scan camera for GenTL Acquisition. When I individually open each camera one after the other using CVB++, I encounter no issues. However, when attempting to open the cameras in two distinct threads, only the area scan camera opens successfully, while the line scanner thread reports that the acquisition stack is already in use. Therefore, my question is whether it is feasible to operate both cameras in separate threads concurrently.

Hello @zhilen111
the Cvb::DeviceFactory::Open() function is not thread safe and can therefore not be called from multiple threads at the same time.
Once you have your device objects though you can use them in seperate threads concurrently.
So you can open your devices in one thread and then pass them to other threads.

Cheers,
Tim

1 Like

One additional thing to be aware of is that it is not possible to open one camera with the 2nd generation stack (simply load *.vin file) and another one with the 3rd generation stack (discovery with Transport Layer) at the same time. This will not work. Unfortunately a proper error will only be emitted when opening the 2nd generation stack first.