|
Scroom 0.14-48-ga0fee447
|
#include <cstdio>#include <cstdlib>#include <list>#include <memory>#include <string>#include <utility>#include <vector>#include <spdlog/spdlog.h>#include <scroom/assertions.hh>#include <scroom/async-deleter.hh>#include <scroom/logger.hh>#include <scroom/threadpool.hh>#include "queue.hh"
Classes | |
| class | anonymous_namespace{threadpoolimpl.cc}::ThreadList |
| class | anonymous_namespace{threadpoolimpl.cc}::ThreadWaiter |
Namespaces | |
| namespace | anonymous_namespace{threadpoolimpl.cc} |
| ThreadList / ThreadWaiter. | |
Functions | |
| template<typename T > | |
| std::shared_ptr< T > | anonymous_namespace{threadpoolimpl.cc}::NotifyThreadList (std::shared_ptr< T > t, const std::string &s) |
| ThreadPool::Ptr | CpuBound () |
| ThreadPool::Ptr | Sequentially () |
Variables | |
| ThreadWaiter | anonymous_namespace{threadpoolimpl.cc}::waiter |
| ThreadPool::Ptr CpuBound | ( | ) |
ThreadPool for cpu-bound tasks
This ThreadPool has one thread per core in your system. For CpuBound tasks, this is the optimum. Make sure your tasks do not block or wait for anything.
Referenced by Layer::fetchData(), CompressedTile::observerAdded(), and LayerCoordinator::tileFinished().

| ThreadPool::Ptr Sequentially | ( | ) |
ThreadPool for executing tasks sequentially
Tasks that are cpu and/or memory intensive (think "loading large bitmaps") are typically scheduled here, such that only one such task runs at a time.
Note that it is rare to do any actual work on this thread. Especially the cpu-intensive tasks are best delegated to CpuBound(). On this thread, you just wait for the work to complete.
Referenced by PipetteHandler::onSelectionEnd(), WaitForAsyncOp::operator()(), and Scroom::TiledBitmap::scheduleLoadingBitmap().
