Role of context lock for video decoder?


I am trying to understand the role of context locks (CUvideoctxlock) for video decoders (CUvideodecoder). Unfortunately, I am unable to find any information on how to use them and when. An explaination would be much appreciated (I am familiar with the concept of locks/mutaxes etc in general).

When should one use a lock, and when should one skip it (from trying to decipher the public headers, it seems that using locks are optional)?

I my case I am planning to run several decoders in parallell (for decoding several videos simultaneously). Should I use one, several or zero context locks in this case?

Thanks in advance!

If you have multiple threads wanting to work with the context, you need to control access to the context. You also need context pushes and pops.