nfengine
nfengine copied to clipboard
Improve ThreadPool
- [x] Remove AsyncThreadPool. There should be a single thread pool handling both per-frame tasks, as well as long-running async tasks (e.g. resource loading).
- [ ] ThreadPool new features:
- [ ] Dependency on async I/O operation
- [x] Task priorities
- [ ] Task affinities (e.g. async resource loading should be run on all the worker threads, because it would lock frame processing).
- [x] "Waitable taks" - by default all the thread pool task should be "non-waitable" (EnqueueTask method should not return TaskID). If a user provides a special structure (WaitableTask) to CreateTask, then he can wait on main thread for the created task using WaitableTask::Wait(). This will be used for resource loading task and "final" taks in frame processing.
See http://www.swedishcoding.com/wp-content/uploads/2015/03/parallelizing_the_naughty_dog_engine_using_fibers.pdf