Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I implemented a 1:M:N userspace lightweight thread scheduler which has 3 types of threads. 1 scheduler thread, M kernel threads and N lightweight threads.
The scheduler preempts the kernel threads and lightweight threads to switch processing between them and uses timeslices.
I wonder if I can integrate coroutine support as I'm not sure what the difference between a coroutine and a lightweight thread is.
How does it preempt?
I set the for loops and while loops to their limit from the scheduler thread! This ends hot loops!
https://github.com/samsquire/preemptible-thread