Are NVDEC APIs not thread safe?

NvDecoder’s constructor has std::mutex argument which locks cuvid related functions.
Are NVDEC APIs not thread safe?

Hi.

std::mutex in NvDecoder is used for shared resource used within the application.
NVDEC API itself is thread safe.

Thanks.

Thank you.

Hi,
what shared resources do you mean exactly? The only sample app that actually makes use of this mutex is the AppDecPerf sample and it only uses this mutex when multiple decoders are created inside one cuda context. Do you consider the cuda context to be a shared resource that requires locking multiple decoder instances?

Thanks.
Alex

1 Like