Community
cancel
Showing results for 
Search instead for 
Did you mean: 
95 Views

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

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
95 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)
95 Views

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

no parameter is given for wait function

Hyodo__Katsuya
Innovator
95 Views

It seems that it is in OpenVINO R5. If I specify zero, It did not lock the thread. I think a little wonder.
95 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

Reply