-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
kind:featuretopic:multithreadingtough-cookieMulti-faceted and challenging topic, making it difficult to arrive at a straightforward decision.Multi-faceted and challenging topic, making it difficult to arrive at a straightforward decision.
Description
Tracking issue to implement RFC #0002 that will introduce execution contexts into Crystal.
Draft
- RFC 2: ExecutionContext #15302 (all schedulers implemented)
Related pull requests to prepare for the actual implementation:
- Add
Thread#internal_name=
#15298 - Explicit exit from main #15299
- Add
Thread::LinkedList#each
to safely iterate lists #15300 - Fix: Make
Crystal::EventLoop#remove(io)
a class method #15282 - Fix: GC safety in Thread#start #14558 —appears to be wrong (segfaults)
- Add
Crystal.print_buffered(io)
andCrystal.print_error_buffered
#15343 - Initialize
Fiber
with an explicit stack #15409
Actual pull requests that implement some of the RFC (to be extracted from #15302):
- Add fiber queues for execution context schedulers #15345
- RFC 2: Skeleton for ExecutionContext #15350
RFC 2 : Delay Fiber stack association #15404- RFC 2: Add
Fiber::ExecutionContext::SingleThreaded
scheduler #15511 - RFC 2: Add
Fiber::ExecutionContext::Isolated
#15513 - RFC 2: MT safe fiber context switch on AArch64 #15581
- RFC 2: MT safe fiber context switch on ARM #15582
- RFC 2: Add
Fiber::ExecutionContext::MultiThreaded
#15517 - RFC 2: Add
Fiber::ExecutionContext::Monitor
#15599
Related issues (e.g. impacted by MT, or MT paradigm shift):
ThreadLocalValue
is not fiber-aware #15088- Ensuring
class_getter
runs exactly once under concurrent access #14905 - Regression in untyped
getter
macro #15556
Fixes and thread safety
- Fix
Crystal::EventLoop::LibEvent
andFiberExecutionContext
integration #15743 - Fix calling
Fiber::ExecutionContext#enqueue
from bareThread
#15767 - Fix: race condition in
Fiber::ExecutionContext::Isolated#wait
#15872 - Add
Crystal::FdLock
+ integration #16128
Refinements and follow ups
- Add thread safety to
at_exit
#15598 - Update docs for
Fiber::ExecutionContext.default_workers_count
#15664 - Add
Fiber::ExecutionContext::ThreadPool
#15885 - PoC: detach execution context scheduler from running thread during blocking syscall #15871
- Rename execution contexts + improve their docs #15936
- Remove minimum in
Fiber::ExecutionContext::Parallel
#15946 - Add
Fiber::ExecutionContext::Parallel#resize
#15956 - Speed up
Parallel::Scheduler#quick_dequeue?
formax=1
#15961 - Lazily instantiate the event loop of isolated execution contexts #16063
- Drop custom implementation of
Fiber::ExecutionContext::Concurrent
#16135 - Default execution context is now parallel (MT:1) #16136
- Improve
Fiber::ExecutionContext.default_workers_count
#16149
devnote-dev, jwoertink, Sija, mverzilli and Mitrug
Metadata
Metadata
Assignees
Labels
kind:featuretopic:multithreadingtough-cookieMulti-faceted and challenging topic, making it difficult to arrive at a straightforward decision.Multi-faceted and challenging topic, making it difficult to arrive at a straightforward decision.
Type
Projects
Status
In Progress