-
Notifications
You must be signed in to change notification settings - Fork 431
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
Use 1 CPU only when "proc_open" function is disabled #514
Conversation
Thank you! |
// from brianium/paratest | ||
$cores = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only works in the happy flow, are you sure of removing this line, also the comment on 16 becomes obsolete? See 36, this might break if popen returns false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please open a new issue or send a PR if you have any doubts.
See theofidry/cpu-core-counter#11 for the motivations. The code should be sensibly the same, the notable differences are: - fixed the deprecated usage of `hw.ncpu` - /proc/cpuinfo is check _last_ - nproc is checked first (before was not checked at all, it's considered to be more accurate and less convoluted than cpuinfo though) - not sure about the `return 2`, but this was not too clear [here](phpstan#514 (review)) neither. I could otherwise change the fallback value to return `1` if `proc_open` doesn't exist and 2 otherwise - add more ways to find the CPU cores count
See theofidry/cpu-core-counter#11 for the motivations. The code should be sensibly the same, the notable differences are: - fixed the deprecated usage of `hw.ncpu` - /proc/cpuinfo is check _last_ - nproc is checked first (before was not checked at all, it's considered to be more accurate and less convoluted than cpuinfo though) - not sure about the `return 2`, but this was not too clear [here](phpstan#514 (review)) neither. I could otherwise change the fallback value to return `1` if `proc_open` doesn't exist and 2 otherwise - add more ways to find the CPU cores count
See theofidry/cpu-core-counter#11 for the motivations. The code should be sensibly the same, the notable differences are: - fixed the deprecated usage of `hw.ncpu` - /proc/cpuinfo is check _last_ - nproc is checked first (before was not checked at all, it's considered to be more accurate and less convoluted than cpuinfo though) - not sure about the `return 2`, but this was not too clear [here](phpstan#514 (review)) neither. I could otherwise change the fallback value to return `1` if `proc_open` doesn't exist and 2 otherwise - add more ways to find the CPU cores count
See theofidry/cpu-core-counter#11 for the motivations. The code should be sensibly the same, the notable differences are: - fixed the deprecated usage of `hw.ncpu` - /proc/cpuinfo is check _last_ - nproc is checked first (before was not checked at all, it's considered to be more accurate and less convoluted than cpuinfo though) - not sure about the `return 2`, but this was not too clear [here](phpstan#514 (review)) neither. I could otherwise change the fallback value to return `1` if `proc_open` doesn't exist and 2 otherwise - add more ways to find the CPU cores count
See theofidry/cpu-core-counter#11 for the motivations. The code should be sensibly the same, the notable differences are: - fixed the deprecated usage of `hw.ncpu` - /proc/cpuinfo is check _last_ - nproc is checked first (before was not checked at all, it's considered to be more accurate and less convoluted than cpuinfo though) - not sure about the `return 2`, but this was not too clear [here](phpstan#514 (review)) neither. I could otherwise change the fallback value to return `1` if `proc_open` doesn't exist and 2 otherwise - add more ways to find the CPU cores count
See theofidry/cpu-core-counter#11 for the motivations. The code should be sensibly the same, the notable differences are: - fixed the deprecated usage of `hw.ncpu` - /proc/cpuinfo is check _last_ - nproc is checked first (before was not checked at all, it's considered to be more accurate and less convoluted than cpuinfo though) - not sure about the `return 2`, but this was not too clear [here](phpstan#514 (review)) neither. I could otherwise change the fallback value to return `1` if `proc_open` doesn't exist and 2 otherwise - add more ways to find the CPU cores count
See theofidry/cpu-core-counter#11 for the motivations. The code should be sensibly the same, the notable differences are: - fixed the deprecated usage of `hw.ncpu` - /proc/cpuinfo is check _last_ - nproc is checked first (before was not checked at all, it's considered to be more accurate and less convoluted than cpuinfo though) - not sure about the `return 2`, but this was not too clear [here](#514 (review)) neither. I could otherwise change the fallback value to return `1` if `proc_open` doesn't exist and 2 otherwise - add more ways to find the CPU cores count
otherwise PHPStan fails with message:
and
maximumNumberOfProcesses
must be set manually to 1.