Luxand FaceSDK – Thread Safety
This chapter describes the use of FaceSDK in applications, processing multiple threads. If your program is executed in a single thread (by default it happens in almost all environments), you can skip this chapter.
Most of FaceSDK functions are safe for multithreaded operations except webcam-related functions. It is strongly recommended to use these functions only within one thread. The functions not guaranteed to be thread-safe are:
When working with cameras in multiple threads on Windows platforms, make sure that each thread calls the FSDK_InitializeCapturing function and the FSDK_FinalizeCapturing function when the thread is done. The following functions are thread safe (on all supported platforms) given that no different threads are simultaneously accessing the same camera handle:
The following functions set global parameters that have effect on each thread:
For more information on thread safety of Tracker API, see the Thread Safety section in the Tracker API chapter.