From 7ecf913256fb396e3027aac3318d996a716a52ef Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Oct 2021 23:29:21 +0800 Subject: + job system --- Runtime/Threading/JobSystem.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Runtime/Threading/JobSystem.h (limited to 'Runtime/Threading/JobSystem.h') diff --git a/Runtime/Threading/JobSystem.h b/Runtime/Threading/JobSystem.h new file mode 100644 index 0000000..c95037c --- /dev/null +++ b/Runtime/Threading/JobSystem.h @@ -0,0 +1,22 @@ +#pragma once +#include "Runtime/Utilities/Singleton.h" +#include "Runtime/Threading/Thread.h" +#include + +class JobSystem : public Singleton +{ +public: + JobSystem(); + ~JobSystem(); + + void AddJobAtEnd(Job* job); + + void Initilize(int workThreadCount = 1); + void Dispatch(void* param); + +private: + WorkThread* SelectThread(); + + std::vector m_Threads; + +}; \ No newline at end of file -- cgit v1.1-26-g67d0