Skip to content

Conversation

@dustinhiatt-wf
Copy link
Contributor

CODE REVIEW

Fixes potential issue on single core machines.

@alexandercampbell-wf @beaulyddon-wf @tannermiller-wf @ericolson-wf @stevenosborne-wf @tylertreat-wf @rosshendrickson-wf

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why this works. Can you explain?

Either way, it would be nice to wrap our NumCPU() calls in some utility function that would do this for us.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're just checking to see if there are an odd number of CPUs. In most cases a user will have 1, 2 and then some multiple of 2 thereafter. If someone intentionally disabled a CPU to get an odd number (someone who has more than one core) this will also even that out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, and AMD at least went through a phase where they sold triple-core processors. I actually have one at home in my desktop; fourth core unlocked and overclocked of course 😄

@alexandercampbell-wk
Copy link
Contributor

+1

1 similar comment
@tannermiller-wf
Copy link
Contributor

+1

dustinhiatt-wf added a commit that referenced this pull request Feb 10, 2015
Fixed potential issue on single core machine.
@dustinhiatt-wf dustinhiatt-wf merged commit 8ff933b into master Feb 10, 2015
@tylertreat-wf
Copy link
Contributor

+1

@alexandercampbell-wk alexandercampbell-wk deleted the sort_single_cpu branch February 11, 2015 14:44
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.

5 participants