The Code demonstratates several ideas.
- Communication between caller code and an event loop through a lock free queue. This eliminates the need for intrusive fine-grain locking.
- The implementation of futures/promises through by way of a condition variable.
- Exposing a library implemented in C++ through a clean C interface. This eliminates most ABI issues, and makes the library easy to embed in other languages.
- Cool nerd points for lock free implementations of MPSC and SPSC queues.
cmake -DCMAKE_BUILD_TYPE=Debug && make && ./build/bin/libuv-test