Crystal language introduces Execution Contexts, a new multithreading model replacing the legacy 'preview MT' scheduler. Three context types are provided: Concurrent (fibers run concurrently on one thread), Parallel (fibers scale across CPU cores with work stealing), and Isolated (a single fiber owns a dedicated thread). The default context starts concurrent on one thread to avoid breaking existing apps, but can be resized for parallelism. Key breaking changes include fibers being able to switch threads in parallel contexts, schedulers moving threads on blocking syscalls like getaddrinfo, and removal of the spawn(same_thread: true) argument. The new scheduler is faster than all legacy schedulers and auto-scales to CPU cores roughly every 100ms. Legacy preview_mt and without_mt flags remain temporarily supported but are discouraged.
Nguồn: https://crystal-lang.org/2026/07/12/releasing-execution-contexts. 8sync News chỉ tóm tắt và dẫn link; bản quyền nội dung thuộc tác giả và nguồn gốc.