Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.
Multiple Threads using Codec Engine Handle
Within a process, all threads can technically share the same Engine handle returned from
Engine_open(). However, as documented in the
Engine_open() API Reference Guide, this Engine handle is not thread-safe, meaning only one thread should use it at a time.
The common and recommended usage for multi-threaded applications is to, rather than have one thread obtain Engine handle and share it, have each thread independently call
Engine_open() to obtain its own Engine handle. As expected, before exiting, each thread should also call
The order is not important. In homogeneous multicore systems, the slave will be loaded when the first thread calls
Engine_open() calls will return unique Engine handles, and increment a reference count on the slave device. Once the last thread calls
Engine_close(), the reference count will reach zero and the slave will be unloaded/stopped.
Finally, note that these details are all local to a single process. When multiple applications may need to use a slave processor, they should be configured to use the Link Arbiter Daemon - LAD.