Hi there,
Long-time lurker. A few years ago, I was pondering whether it would make sense for Ada/GNAT to have tasks that wouldn’t just map 1:1 to OS threads. But it wasn’t quite economical to try that out at the time.
Recently, I’ve decided to close this open loop by running a quick experiment over the weekend – the result is a patched RTS and additional runtime primitives that provide lightweight tasks and asynchronous I/O to Ada users. So far, the results have been promising – the overhead of individual threads can be fairly high under high task concurrency, and lightweight tasks mitigate it. Best of all, this doesn’t automatically make all tasks lightweight. Instead, by default tasks remain “native” and lightweight is an opt-in pragma.
On top of that foundation, I’ve cobbled together some I/O (sockets, files, DNS) and additional higher-level libraries for HTTP server & client, Postgres BE/FE protocol, and such. Some performance measurements are fairly encouraging.
You can check it out at https://flyology.org – it’s still running 0.1-dev and is hosted on its own Alire index.
Would love your thoughts.
P.S. Take this with a grain of salt. I am not a longtime member of the Ada community, but I feel that Ada’s approach to tasking could benefit from adopting this approach to system engineering.