Taro: Task Graph-Based Asynchronous Programming Using C++ Coroutine – Dian-Lun Lin - CppCon 2023

Discover Taro, a task graph-based system for asynchronous programming in C++ coroutines, enabling multitasking and efficient scalability, with comparable performance to industry-standard test flow.

Key takeaways
  • Taro is a task graph-based programming system that uses C++ coroutines to enable asynchronous programming.
  • Taro encapsulates function codes and dependencies in a top-down task graph, allowing for easier writing and expressing of test graphs.
  • Coroutines are used to enable multitasking and reduce runtimes by allowing tasks to be suspended and resumed.
  • The algorithm used in Taro is synchronized, which means that the coroutine-aware scheduling algorithm is aware of the tasks’ dependencies and priorities.
  • The system is designed to be scalable and extensible, making it easy to add new tasks and dependencies.
  • Test flow, a state-of-the-art test graph-based programming system, is used as the baseline for microbenchmarks.
  • Taro achieves similar performance to test flow in many cases, but with the added benefits of coroutines and multitasking.
  • The system is designed to reduce the overhead of task switching and improve system scalability.
  • Taro’s scheduling algorithm is designed to prioritize tasks based on their dependencies and priorities, making it easier to write efficient and scalable code.
  • The system is open-source and available for use and modification.
  • Taro’s program model allows users to define tasks and dependencies in a simple and intuitive way, making it easy to write and express test graphs.
  • The system uses a high-priority queue to store suspended tasks, which are prioritized over new tasks to ensure that suspended tasks are executed first.
  • The system is designed to be flexible and extensible, making it easy to add new tasks and dependencies.
  • Taro is a promising technology for building efficient and scalable systems, and is suitable for a wide range of applications where asynchronous programming is necessary.