I really wanted to understand how Go's runtime works. I suppose that the best way to research smth - write it by yourself. So this project is only my effort to understand it. This lib doesn't ready for production. For example I wrote specific context switching and I don't know how it works on Window/MacOS or another CPU arch. I try to write good unit tests with diffrent sanitizers and cases. However, I don't think it's enough. For example for simular project fault injection is a good way to found a conccurancy problem.
I must admit that every decision is made in the design of the system imperfectly. Every design is trade off.
When I work with this lib I understood that concurrency is really too hard.
- x86-64
- Linux
- Clang++18
You can find more information:
sudo apt-get install python3 python3-pip python3-setuptools python3-wheel ninja-build
python3 -m venv env
pip install -r requirements.txt
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
# /usr/bin/clang++ is clang++-18
conan install . -of=build --build=missing -pr:a=./config/debug_profile
meson setup --native-file build/conan_meson_native.ini build . --buildtype debug
meson compile -C build
meson test -C build
Main part for implementation stackfull coroutine.
My implementation of stackfull coroutine.
Scheduler, executor.
- manual executor, step by step
- simple intrusive thread pool
- strand executor
- my last work - thread pool with sharded workers
Stackfull coroutine + Executor = Fibers. Im proud of async mutex, wait group, event.
P.S. Thanks for R.Lipovsky for his wonderfully program :)