1

For a project with a very large database I am using the following two procedures thousands of times in a loop:

select_points_object_model_3d()
render_object_model_3d()

This takes hours and hours for every test as it is using only 1/16 cores. Now I was wondering: Is there a way to run multiple HDev engines in different threads all executing said procedures?

2 Answers 2

2

I forgot to come back to this when I found a solution. For the next one who is stuck on this. Using taskList[i] = new Task<>(() => {"task code"}); I was able to run 450+ tasks that use HOP.SelectPointsObjectModel3d() and HOP.RenderObjectModel3d() consecutively completely utilizing all my cores. I didn't need multiple engines or anything like that.

Sign up to request clarification or add additional context in comments.

Comments

1

You can try to work with halcon multithreading operators.

Infinitely running:

par_start<Thread1>: procedure(...)

Wait for threads to finish:

par_start <Thread1> : process (...)
par_start <Thread2> : process (...)
par_join ([Thread1, Thread2])

See: https://www.mvtec.com/doc/halcon/12/en/par_join.html

1 Comment

Hi! thnx for helping. I think (not sure) that this won't work as the help page of render_object_model_3d states: "Multithreading type: mutually exclusive (runs in parallel with other non-exclusive operators, but not with itself)." That's why I was hoping that having multiple engines running in C# with HalconDotNet would be possible somehow

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.