AODQ / pulchritude-engine

lingua franca game engine
MIT License
0 stars 0 forks source link

PuleTask - Task Engine Library #3

Open AODQ opened 2 years ago

AODQ commented 2 years ago

PuleTask will allow creation of tasks that map to thread pools, as well as dedicated thread tasks. This might require tight coupling with ECS as that component will make extensive use of this library. Currently multi-threading is done with just the ECS library (the current backend natively supports multithreading), but at some point it will be stripped to use our own task system. This will give better task integration with the rest of the engine, as ECS will be independent from tasks.

The implementation should be relatively simple. Create tasks, possibly create dependencies on these tasks, then execute them on a thread-pool. Each thread in the thread-pool will have a known set of tasks to complete per-frame, so the threads do not have to share or synchronize work-loads. Possibly there might be an additional thread in the thread-pool that handles tasks that may be triggered inconsistently, such as resource loading.