User manual

Table Of Contents
Small Vision System User Manual 50
5.1 Threading and Multiple Stereo Devices
5.1.1 Threading Issues
The SVS core library functions (svs.dll, libsvs.so) are thread-safe: they can be used in any
thread in a process. Of course, the user is responsible for not overlapping calls in different threads, e.g.,
starting up two competing disparity calculations using the same object in different threads.
The MEGA-D and Dual-DCAM acquisition libraries are also thread-safe, in general. However, there
are some known quirks under MS Windows. The most obvious of these is the
Open() call for the
MEGA-D. This call must be made in the main thread. Subsequent accesses using
GetImage() can be
made in any thread.
Graphic window output is handled by the FLTK cross-platform windowing system. This system is
not, in general, thread safe. Calls to the FLTK functions must all be made from the same thread; multiple
threads are allowed in the application program, as long as all FLTK calls come from the same thread.
There is a nascent thread locking mechanism in FLTK, but it is not yet incorporated into SVS.
5.1.2 Multiple Devices
Multiple stereo devices (MEGA-D and Dual-DCAM) can be accessed simultaneously from a single
process, or from multiple processes. Only one process may access a given device, using an
Open() call.
Once this call is made, subsequent calls to
Open() from other processes will fail until the device is
released.
Currently, there are several restrictions on multiple device usage. Most of these restrictions apply to
the MEGA-D.
1. Under Win32, the MEGA-D reserves most of the bus bandwidth, even if the frame rate is
lowered with the SetRate() call. Therefore, for the present it is possible to stream video from
multiple devices simultaneously only if they are on different IEEE 1394 busses, i.e., attached
to separate IEEE 1394 cards. This restriction should be lifted in the near future. There is no
such restriction under Linux.
2. When using multiple devices on the same IEEE 1394 bus, it may be necessary to lower the
frame rate or frame size before starting streaming video. For example, the Dual-DCAM can
use most of the bus bandwidth at 640x480, 15 Hz. Setting the frame rate to 7.5 Hz, or the
frame size to 320x240, will allow more devices to be accessed.