diff options
author | David Robillard <d@drobilla.net> | 2016-09-12 22:37:22 +0800 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-10-02 12:24:56 -0400 |
commit | 9b8bce71893ef450992f82a28a6a0287c479baaf (patch) | |
tree | 8c9c240e32f8201d2f999a2de2baaca6281783c3 /src/server/Engine.hpp | |
parent | 938456884934a74a2850c02edc17575021131709 (diff) | |
download | ingen-9b8bce71893ef450992f82a28a6a0287c479baaf.tar.gz ingen-9b8bce71893ef450992f82a28a6a0287c479baaf.tar.bz2 ingen-9b8bce71893ef450992f82a28a6a0287c479baaf.zip |
Add parallel graph execution
Diffstat (limited to 'src/server/Engine.hpp')
-rw-r--r-- | src/server/Engine.hpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/server/Engine.hpp b/src/server/Engine.hpp index 16699293..2d5e053e 100644 --- a/src/server/Engine.hpp +++ b/src/server/Engine.hpp @@ -17,9 +17,10 @@ #ifndef INGEN_ENGINE_ENGINE_HPP #define INGEN_ENGINE_ENGINE_HPP -#include <random> - #include <boost/utility.hpp> +#include <condition_variable> +#include <mutex> +#include <random> #include "ingen/EngineBase.hpp" #include "ingen/Interface.hpp" @@ -115,7 +116,14 @@ public: Worker* worker() const { return _worker; } Worker* sync_worker() const { return _sync_worker; } - RunContext& run_context() { return _run_context; } + RunContext& run_context() { return *_run_contexts[0]; } + + void locate(FrameTime s, SampleCount nframes); + void emit_notifications(FrameTime end); + bool pending_notifications(); + bool wait_for_tasks(); + void signal_tasks(); + Task* steal_task(unsigned start_thread); SPtr<Store> store() const; @@ -144,11 +152,14 @@ private: Worker* _sync_worker; SocketListener* _listener; - RunContext _run_context; + std::vector<RunContext*> _run_contexts; std::mt19937 _rand_engine; std::uniform_real_distribution<float> _uniform_dist; + std::condition_variable _tasks_available; + std::mutex _tasks_mutex; + bool _quit_flag; bool _direct_driver; bool _atomic_bundles; |