4 ms·
I implemented a simple round robin userspace 1:M:N scheduler in Rust, Java and C. It has 1 schedule thread that preempts kernel and lightweight threads and M k
by samsquire 4y ago
I implemented a simple round robin userspace 1:M:N scheduler in Rust, Java and C.
It has 1 schedule thread that preempts kernel and lightweight threads and M kernel threads and N lightweight threads
Hot for and while loops can be interrupted by setting the looping variable to the limit.
https://GitHub.com/samsquire/preemptible-thread https://GitHub.com/samsquire/preemptible-thread
I am currently investigating coroutine transpilation with async await similar to Protothreads implementation that uses switch statements. I am trying to do it all in one loop rather than reentrant functions as in Protothreads.
Essentially I break the code up around the async/await and put different parts into a switch. I "think* it's possible to handle nested while loops inside these coroutines.
The problem I don't know how to handle is if a coroutine A calls coroutine B and B calls A. I get the growing data problem which I'm trying to avoid. I want fixed size coroutine list
I think some Microservices take more CPU than others. You can scale one Microservice more than another based on CPU usage.
Another of my benchmarks is multithreading message generation and sending it between threads in thread safe. I can get 20-100 million message sent per second, sending in batches