@@ -37,11 +37,11 @@ require "./execution_context/*"
3737# for common use cases.
3838#
3939# * `ExecutionContext::Concurrent`: Fully concurrent with limited parallelism.
40- # Fibers run concurrently, never in parallel (only one fiber at a time). They
41- # can use simpler and faster synchronization primitives internally (no atomics,
42- # limited thread safety). Communication with fibers in other contexts requires
43- # thread-safe primitives. A blocking fiber blocks the entire thread and all
44- # other fibers in the context.
40+ # Fibers run concurrently to each other , never in parallel (only one fiber at a
41+ # time). They can use simpler and faster synchronization primitives internally
42+ # (no atomics, limited thread safety). Communication with fibers in other
43+ # contexts requires thread-safe primitives. A blocking fiber blocks the entire
44+ # thread and all other fibers in the context.
4545# * `ExecutionContext::Parallel`: Fully concurrent, fully parallel. Fibers
4646# running in this context can be resumed by multiple system threads in this
4747# context. They run concurrently and in parallel to each other (multiple fibers
@@ -73,6 +73,10 @@ module Fiber::ExecutionContext
7373
7474 # Returns the default `ExecutionContext` for the process, automatically
7575 # started when the program started.
76+ #
77+ # The default execution context is currently `Parallel` but only starts with
78+ # parallelism set to 1. The parallelism can be changed using
79+ # `Parallel#resize`.
7680 @[AlwaysInline ]
7781 def self.default : ExecutionContext
7882 @@default .not_nil!(" expected default execution context to have been setup" )
@@ -163,8 +167,7 @@ module Fiber::ExecutionContext
163167 end
164168 end
165169
166- # Creates a new fiber then calls `#enqueue` to add it to the execution
167- # context.
170+ # Creates a new fiber then calls enqueues it to the execution context.
168171 #
169172 # May be called from any `ExecutionContext` (i.e. must be thread-safe).
170173 def spawn (* , name : String ? = nil , & block : - > ) : Fiber
0 commit comments