Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I tried to create a simple TCP server framework that uses coroutines. So, how it works is that when a read/write operation on a TCP socket blocks, the coroutine gets suspended. The underlying thread that is running the coroutine is then free to run other tasks, so this enables for concurrency with relatively few threads.
coroutines as they exist are a lower level construct which is vastly better with a higher level library to make it usable for programmers. One such library is cppcoro but at some stage we'll see an equivalent in the standard library.
If you're curious, here is the half-baked, unfinished, and uncommented repo: https://github.com/Vociferix/crasy
See, this is what my cpp14 library does and is compatible with cpp20 coroutines https://github.com/ladnir/macoro
Yes: https://github.com/chriskohlhoff/asio/blob/master/asio/include/asio/coroutine.hpp
Try https://github.com/YACLib/YACLib It works with coroutines on most possible platforms and tested very well Also contains very effective synchronization primitives