I've been working on Thryve: a multithreading task engine that is written in Rust with a C API. Plugins, self-contained parts of a program that serve a purpose, send tasks; observers, which listen for events, receive notifications; and the engine runs the tasks on one pool of worker threads. Plugins can interact with each other in a cohesive but decoupled manner, and observers can process notifications and send tasks based on what they received. The decoupling of plugins allows plugins to not reference each other.

In the video, one program runs two unrelated, multithreaded projects in one engine: a report on a web server's access log, and a count of the primes below 10,000,000. Each project declares its steps (split into N tasks, join the results of N tasks to perform another task, fan a result out to a group of different tasks, each processing the result in its own way), and the engine runs each step as soon as that step's input is ready. Both projects send their tasks to the engine and share the same 4 worker threads, with the engine handling each project's tasks and results. Naming projects on the command line picks which ones run.

Thryve: two jobs, one engine, no thread code (one-minute Rust demo)

The same example is in the repo in Rust, C, C++ and Python, and prints the same output in each. It runs on Windows only for now.

What would you run on it?

Code and examples: GitHub - thryveframework/thryve: The main Thryve Framework repository. It contains the FFI content as well · GitHub

I posted a write-up, explaining Thryve in more detail and how the two projects share the workers: How Thryve works, with two projects in one engine | Thryvals

1 post - 1 participant

Read full topic