Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance/multi-node: Fix possible race. #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

e-harvey
Copy link
Contributor

I find this way of passing data to the thread function much more readable than what was there before.

  • Removed per_iteration_data struct.
    • This struct was being used to pass in a thread id
      to each pthread but that thread_id may have been
      overwritten before creating the next thread.

    • The thread id and message size was moved to the
      per_thread_data struct which is then passed to
      pthread create in an effort to avoid the race described above.

I'm not sure if theee is a race here before this PR but it looked like the thread id field of the other key could get stomped on between calls to pthread create.

Signed-off-by: Evan Harvey [email protected]

 - Removed per_iteration_data struct.
   - This struct was being used to pass in a thread id
   to each pthread but that thread_id may have been
   overwritten before creating the next thread.

  - The thread id and message size was moved to the
  per_thread_data struct which is then passed to
  pthread create in an effort to avoid the race described above.

Signed-off-by: Evan Harvey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant