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

Support more OSes (WIP) #3

Merged
merged 3 commits into from Mar 2, 2015

Conversation

Projects
None yet
2 participants
@jbarrett
Contributor

jbarrett commented Feb 23, 2015

Hi,

I was assigned this for Feb in the PR challenge:

http://blogs.perl.org/users/neilb/2014/12/take-the-2015-cpan-pull-request-challenge.html

So, this PR attempts to broaden the OS support. The POSIX::sysconf call should work on basically any *nix. If sysconf fails or we know it's not available, we fall back to a system-specific command to get num cores from /proc, environment, etc.

TODO:

  • Check out robustness of sysconf across any platforms I can get my hands on.
  • Create more fallbacks (multiple per-OS?).
  • Count processors online vs processors configured?

I'm opening the PR at this stage to find out whether you like the look of the changes or not - if not, I'll back off. If so (or if I hear nothing), I'll continue :)

Thanks!

jbarrett added some commits Feb 9, 2015

Attempt sysconf(3) to get processor count, with command line fallback.
This should open up support for a wider array of OSes.
Don't use FFI for functions exported in POSIX.
This attempts to use sysconf SC_NPROCESSORS_ONLN to cover processor
count retrieval on all *nix.

@jbarrett jbarrett changed the title from Support more oses (WIP) to Support more OSes (WIP) Feb 23, 2015

@xdbr xdbr merged commit 0977043 into xdbr:master Mar 2, 2015

@xdbr

This comment has been minimized.

Owner

xdbr commented Mar 2, 2015

Thanks a million for your pull request @jbarrett and apologies for the late respone!

@jbarrett

This comment has been minimized.

Contributor

jbarrett commented Mar 3, 2015

Thanks @xdbr - I wasn't quite finished (could add more fallbacks for common OSes, *BSDs at least) but not to worry, can open another PR when I get round to those.

@xdbr

This comment has been minimized.

Owner

xdbr commented Mar 5, 2015

any time, please do!

@jbarrett jbarrett deleted the jbarrett:support-more-oses branch Mar 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment