diff --git a/src/fiber/execution_context.cr b/src/fiber/execution_context.cr index 17ddc018270b..25ba381e74f1 100644 --- a/src/fiber/execution_context.cr +++ b/src/fiber/execution_context.cr @@ -25,7 +25,13 @@ module Fiber::ExecutionContext @@monitor = Monitor.new end - # Returns the default number of workers to start in the execution context. + # Returns the number of threads to start in the default multi threaded + # execution context. Respects the `CRYSTAL_WORKERS` environment variable + # and otherwise returns the potential parallelism of the CPU (number of + # hardware threads). + # + # Currently unused because the default context is single threaded for + # now (this might change later with compilation flags). def self.default_workers_count : Int32 ENV["CRYSTAL_WORKERS"]?.try(&.to_i?) || Math.min(System.cpu_count.to_i, 32) end