机器视觉 par_join算子
Posted 沧海一笑-dj
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了机器视觉 par_join算子相关的知识,希望对你有一定的参考价值。
00. 目录
01. 概述
par_join - 等待使用par_start启动的子线程。
02. 签名
par_join( : : ThreadID : )
03. 描述
par_join算子用于在调用程序中等待所有在单独的子线程中启动的程序或算子,方法是将par_start(启动的线程)添加到相应的程序行中( by adding the par_start qualifier to the according program line)。 要等待的子线程由它们传递给算子参数ThreadID的线程ID标识。
注意:par_start不是一个算子,而是一个在程序行开头添加的标识符,表明与调用程序并行执行。 语法是par_start :后跟实际的程序或算子调用。
原文描述:
The par_join operator is used to wait in the calling procedure for all procedures or operators that have been started in separate subthreads by adding the par_start qualifier to the according program line. The subthreads to wait for are identified by their thread ids that are passed to the parameter ThreadID.
Attention: par_start is not an operator but a qualifier that is added at the begin of the program line that has to be executed in parallel to the calling procedure. The syntax is par_start : followed by the actual procedure or operator call.
04. 注意
略
05. 参数
ThreadID (input_control) thread_id(-array) → (integer)
所有要等待的子线程的ID。
06. 结果
如果指定参数的值正确,则par_join返回2(H_MSG_TRUE)。 否则会引发异常并返回错误代码。
HDevelop例程
simulate_aop.hdev Simulate automatic operator parallelization (AOP) and compare execution times
pipeline_multiple_threads_per_stage.hdev Show how to implement a pipeline with multiple threads per stage
par_start.hdev Read bar codes and data codes in parallel using multithreading
message_queue_producer_consumer_abort.hdev Use a message queue to exchange data between threads running in parallel (producer consumer)
message_queue_producer_consumer.hdev Use a message queue to exchange data between threads running in parallel (producer consumer)
interrupt_operator.hdev Interrupt a running operator from another thread
get_current_hthread_id.hdev Get the thread ID of the currently running thread
程序示例
* start two procedures in separate sub threads
par_start <ThreadID1> : producer_proc()
par_start <ThreadID2> : consumer_proc()
* wait until both procedures have finished
par_join ([ThreadID1, ThreadID2])
07. 附录
7.1 机器视觉博客汇总
网址:https://dengjin.blog.csdn.net/article/details/116837497
以上是关于机器视觉 par_join算子的主要内容,如果未能解决你的问题,请参考以下文章