Questions releated to CUvideoctxLock

Hi, I’m working in Cuda 8.0, with OpenGL, to decode multiple videos at the same time. Now I have some questions:

"

  1. why do we need to create a CUvideoctxlock? can I remove it? What areas of the Cuda calls needs to be locked while being accessed?
  2. If I call cuvidCtxLock(), what will happen? what is the deeper meaning behind this function? will all the other operations in the same context be blocked?
    "

I found this thread which is related to my problems, but I still don’t get it, can anyone help me?

I found this thread which is related to my problems, but I still don’t get it, can anyone help me?

https://devtalk.nvidia.com/default/topic/498757/threaded-cuda-video-decoding/?offset=4