3 ms·
Thanks for this article and to ingve for submitting it. Concurrency and async is my favourite topic. I think event loop programming is very interesting, and G
by samsquire 3y ago
Thanks for this article and to ingve for submitting it.
Concurrency and async is my favourite topic.
I think event loop programming is very interesting, and Goroutines mean every process is effectively an event loop. So I like server programming. I have an epoll server that multiplexes multiple sockets per thread which is a bit more scalable than a thread per socket. I like nodejs libuv, but I think we can go further.
I wrote a very simple toy lightweight 1:M:N (1 scheduler:M kernel threads:N lightweight threads) thread scheduler in C, Rust and Java.
https://github.com/samsquire/preemptible-thread https://github.com/samsquire/preemptible-thread
It works on the principle that hot loops can be interrupted BY ANOTHER THREAD (the scheduler thread) on a timer by setting a loop to its limit, to give lightweight threads a chance to execute.
What I think I want today though is an extremely rich process/concurrency API that resembles a stream API but for processes. For example, we should be able to create pipelines that can be paused, resumed, forked, merged, drop_while, iterate_until and whatever else would be useful.
- pdimitar 3y agoTry Elixir?