Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Under multithreading environment wait on one async request handle, blocks other request

Palanisamy__Vignesh
445 Views
def thread():
        net = inference_engine.IENetwork(model=os.path.join(model_dir, '{}_{}.xml'.format(*shape)), weights=os.path.join(model_dir, '{}_{}.bin'.format(*shape)))
        plugin = inference_engine.IEPlugin(device="CPU")
        plugin.set_config({'CPU_BIND_THREAD':'NO', 'CPU_THREADS_NUM':'6', 'CPU_THROUGHPUT_STREAMS':'2'})
        plugin.add_cpu_extension('libcpu_extension.so')
        exec_net = plugin.load(net, 2)
        exec_net.start_async(req_id, args)
        exec_net.requests[req_id].wait()

 

When running thread function in two threads, wait in one thread blocks other thread's execution of request, tried creating plugin and net globally no difference

0 Kudos
4 Replies
Hyodo__Katsuya
Innovator
445 Views
Since I have not tried it, I can not say cleary things. Correctly the parameter is not zero? exec_net.requests[req_id].wait(0)
0 Kudos
Palanisamy__Vignesh
445 Views

it is exactly exec_net.requests[req_id].wait()

no parameter is given for wait function

0 Kudos
Hyodo__Katsuya
Innovator
445 Views
It seems that it is in OpenVINO R5. If I specify zero, It did not lock the thread. I think a little wonder.
0 Kudos
Palanisamy__Vignesh
445 Views

If u give zero for wait() it'll not block until the result is ready, so we have to give -1 or no param which blocks until the result is ready

Selection_001.png

0 Kudos
Reply