alliedvision / VimbaPython

Old Allied Vision Vimba Python API. The successor to this API is VmbPy
BSD 2-Clause "Simplified" License
93 stars 40 forks source link

Process vs. Thread for multithreading #170

Open mprat opened 11 months ago

mprat commented 11 months ago

The example in multithreading_opencv.py uses Thread objects rather than multiprocessing.Process objects in Python.

I have an implementation that simultaneously is attempting to stream from 2 cameras in separate Process objects rather than Thread objects on an Ubuntu machine, and we are seeing some inconsistencies in how Vimba behaves. We have two GigE cameras connected on separate NICs.

Is there a reason that Threads are preferred? Is there an issue fork-ing the Vimba singleton in Process objects that could be causing an issue? The default behavior in creating Process objects on Linux is fork rather than spawn, so it is possible that using spawn does not create a problem for the Vimba singleton?