Skip to content

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