【机器视觉】 par_join算子
00. 目錄
文章目錄
- 00. 目錄
- 01. 概述
- 02. 簽名
- 03. 描述
- 04. 注意
- 05. 參數
- 06. 結果
- 07. 附錄
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算子的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【机器视觉】 import算子
- 下一篇: 【机器视觉】 return算子