[Openmp-commits] [PATCH] D142247: Fix initialization of th_task_state on each thread on expanding hot teams.

Terry Wilmarth via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Feb 9 10:51:27 PST 2023

tlwilmar added a comment.

@rogfer01 th_task_state is used to refer to one of two task teams that are reused for each hot team. These two task teams exist because of a need to start using a new one while there may still be activity on the old task team, so we flip between the two.  Each thread has a th_task_state so it knows which task team is in use for a particular parallel region.  When a hot team is expanded in size for a larger parallel region, new threads added to the team need to have their th_task_state initialized to exactly what the other threads in the team are using, so that they are all in sync.  So instead, we just initialize from a thread that was in the team before the resize.

  rG LLVM Github Monorepo



More information about the Openmp-commits mailing list