4 ms·
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
by samsquire 4y ago
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 https://github.com/samsquire/preemptible-thread