What are the benefits of using the last thread to reach the join point to execute after sync compared to using the thread that initiated the fork? Does doing so also decrease the overhead of handling the threads?
Araina
@stee, I think using the last thread to reach the join point to execute after sync does decrease the overhead. In this case, this thread does not need to notify the thread that initiated the fork, and just continues to execute the code after sync according to the greedy policy. What's more, the last thread to reach the join point can also be the first thread that initiated the fork.
efficiens
This also ensures that the main thread (or the thread doing the fork()) is never idle
What are the benefits of using the last thread to reach the join point to execute after sync compared to using the thread that initiated the fork? Does doing so also decrease the overhead of handling the threads?
@stee, I think using the last thread to reach the join point to execute after sync does decrease the overhead. In this case, this thread does not need to notify the thread that initiated the fork, and just continues to execute the code after sync according to the greedy policy. What's more, the last thread to reach the join point can also be the first thread that initiated the fork.
This also ensures that the main thread (or the thread doing the fork()) is never idle