RecAPI
|
RecAPI of the OmniPage Capture SDK is a thread-safe API starting from version 16 (supported on: Windows, Linux). This means that the API functions can be called from different threads at the same time.
If each thread uses a Settings Collection separated only for that thread, the thread-safeness is completely true. The same Settings Collection may be also used in different threads at the same time. However, when a value in a Settings Collection is changed in one thread, this new value appears in all the threads using the same Settings Collection. In this case, it is difficult to determine when the functions in the other threads notice this modification.
If this latter case poses a problem for the integrating application, there are two solutions:
The expression thread-safe does not mean all the CSDK elements can work simultaneously.
Both the Engine init and quit should be in the main thread. Otherwise, the application developer must ensure that the Engine is active until the closing RecAPI call of the last thread returns.
Using fork
together with threads can cause issues and requires precautions. In general, forking should precede the creation of new threads. Since CSDK initialization may create threads, fork should take place prior to the initialization.