Multithreading over point groups(one thread - one group)

   149   1   0
User Avatar
Member
49 posts
Joined: 12月 2010
オフライン
Hi everyone. I've got some logic running over points. That logic involves accessing neighbor points and setting some attributes. If I use GA_SplittableRange that causes race condition in this situation so my idea is to split point cloud to n-groups(~threads count), run them in parallel and then do some logic as a final step.

I came across UT_TaskGroup(). Is that one way of doing it ?

Thank you.
User Avatar
スタッフ
709 posts
Joined: 8月 2019
オフライン
Be sure to check this page: https://www.sidefx.com/docs/hdk/_h_d_k__g_a__using.html#HDK_GA_Using_Parallel [www.sidefx.com]

For foreach-style algorithms, the simplest approach is to use GAparallelForEachPage() which provides a higher-level API that is convenient to use with lambdas.
  • Quick Links