-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
M:N threading #1198
M:N threading #1198
Conversation
* add std.atomic.QueueMpsc.isEmpty * make std.debug.global_allocator thread-safe * std.event.Loop: now you have to choose between - initSingleThreaded - initMultiThreaded * std.event.Loop multiplexes coroutines onto kernel threads * Remove std.event.Loop.stop. Instead the event loop run() function returns once there are no pending coroutines. * fix crash in ir.cpp for calling methods under some conditions * small progress self-hosted compiler, analyzing top level declarations * Introduce std.event.Lock for synchronizing coroutines * introduce std.event.Locked(T) for data that only 1 coroutine should modify at once. * make the self hosted compiler use multi threaded event loop * make std.heap.DirectAllocator thread-safe See #174 TODO: * call sched_getaffinity instead of hard coding thread pool size 4 * support for Windows and MacOS * #1194 * #1197
when a thread pool worker accepts a coroutine to resume
Wondering if we need an abstraction for FDs; Better to get threading out of the way first before we fine tune event loops, though. |
Also, this might be of curiosity to you: |
Got it working on MacOS, next up Windows |
@bnoordhuis looks like libuv uses IO Completion Ports. Do you recommend this approach? |
nevermind, it's already done. that was a surprisingly nice API. |
returns once there are no pending coroutines.
modify at once.
See #174
TODO: