class Garcon::ProcessorCounter

Public Class Methods

new() click to toggle source
# File lib/garcon/task/processor_count.rb, line 26
def initialize
  @processor_count          = Delay.new { compute_processor_count }
  @physical_processor_count = Delay.new { compute_physical_count }
end

Public Instance Methods

physical_processor_count() click to toggle source

Number of physical processor cores on the current system. For performance reasons the calculated value will be memoized on the first call.

# File lib/garcon/task/processor_count.rb, line 42
def physical_processor_count
  @physical_processor_count.value
end
processor_count() click to toggle source

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.

# File lib/garcon/task/processor_count.rb, line 35
def processor_count
  @processor_count.value
end