- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it is exactly exec_net.requests[req_id].wait()
no parameter is given for wait function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that it is in OpenVINO R5.
If I specify zero, It did not lock the thread.
I think a little wonder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page