-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
43 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module Concurrent | ||
# Number of physical processor cores on the current system. For performance | ||
# reasons the calculated value will be memoized on the first call. | ||
# | ||
# On Windows the Win32 API will be queried for the `NumberOfCores from | ||
# Win32_Processor`. This will return the total number "of cores for the | ||
# current instance of the processor." On Unix-like operating systems either | ||
# the `hwprefs` or `sysctl` utility will be called in a subshell and the | ||
# returned value will be used. In the rare case where none of these methods | ||
# work or an exception is raised the function will simply return 1. | ||
# | ||
# @return [Integer] number physical processor cores on the current system | ||
# | ||
# @see https://github.com/grosser/parallel/blob/4fc8b89d08c7091fe0419ca8fba1ec3ce5a8d185/lib/parallel.rb | ||
# | ||
# @see http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx | ||
# @see http://www.unix.com/man-page/osx/1/HWPREFS/ | ||
# @see http://linux.die.net/man/8/sysctl | ||
def self.physical_processor_count: () -> Integer | ||
|
||
# Number of processors seen by the OS and used for process scheduling. For | ||
# performance reasons the calculated value will be memoized on the first | ||
# call. | ||
# | ||
# When running under JRuby the Java runtime call | ||
# `java.lang.Runtime.getRuntime.availableProcessors` will be used. According | ||
# to the Java documentation this "value may change during a particular | ||
# invocation of the virtual machine... [applications] should therefore | ||
# occasionally poll this property." Subsequently the result will NOT be | ||
# memoized under JRuby. | ||
# | ||
# Otherwise Ruby's Etc.nprocessors will be used. | ||
# | ||
# @return [Integer] number of processors seen by the OS or Java runtime | ||
# | ||
# @see http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#availableProcessors() | ||
# | ||
def self.processor_count: () -> Integer | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters