File tree 1 file changed +5
-4
lines changed
lib/concurrent-ruby/concurrent/utility
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ def compute_physical_processor_count
83
83
# Bail out if both commands returned something unexpected
84
84
processor_count
85
85
else
86
- # powershell: "\nNumberOfCores\n-------------\n 4\n\n\n"
86
+ # powershell: "\nNumberOfCores\n-------------\n 4\n\n\n"
87
87
# wmic: "NumberOfCores \n\n4 \n\n\n\n"
88
88
result . scan ( /\d +/ ) . map ( &:to_i ) . reduce ( :+ )
89
89
end
@@ -181,13 +181,14 @@ def self.physical_processor_count
181
181
end
182
182
183
183
# Number of processors cores available for process scheduling.
184
- # Returns `nil` if there is no #cpu_quota, or a `Float` if the
185
- # process is inside a cgroup with a dedicated CPU quota (typically Docker).
184
+ # This method takes in account the CPU quota if the process is inside a cgroup with a
185
+ # dedicated CPU quota (typically Docker).
186
+ # Otherwise it returns the same value as #processor_count but as a Float.
186
187
#
187
188
# For performance reasons the calculated value will be memoized on the first
188
189
# call.
189
190
#
190
- # @return [nil, Float] number of available processors
191
+ # @return [Float] number of available processors
191
192
def self . available_processor_count
192
193
processor_counter . available_processor_count
193
194
end
You can’t perform that action at this time.
0 commit comments