[core] Introduce SequencedScheduler and ParallelScheduler

This commit refactors `utils::ThreadPool` into a template
`ThreadedScheduler` class and provides aux type aliases.
So that it is possible to obtain a sequenced schedule,where
all the scheduled tasks are guarantied to be executed
consequently.

The sequenced lightweight scheduler is required by both the
orchestration thread and the refactored `FileSource` implementation.
This commit is contained in:
Mikhail Pozdnyakov
2019-10-07 15:45:45 +03:00
parent bd283fc1be
commit 23cebe20fe
3 changed files with 75 additions and 44 deletions

View File

@@ -28,7 +28,7 @@ std::shared_ptr<Scheduler> Scheduler::GetBackground() {
std::shared_ptr<Scheduler> scheduler = weak.lock();
if (!scheduler) {
weak = scheduler = std::make_shared<ThreadPool>(4);
weak = scheduler = std::make_shared<ThreadPool>();
}
return scheduler;