ML Reference
|
A single-threaded processor that takes one or even multiple tile requests and can process them iteratively. More...
#include <mlSingleThreadedPageRequestProcessor.h>
Public Member Functions | |
SingleThreadedPageRequestProcessor (Host *host=nullptr) | |
~SingleThreadedPageRequestProcessor () override | |
bool | supportsMultiThreading () override |
Returns if multi-threading is supported. | |
void | setNumWorkerThreads (std::size_t) override |
Set the number of threads (ignored by this implementation) | |
void | addRootTileRequest (TileRequest *tileRequest) override |
Adds the root tileRequest that should be processed (the ownership stays with the caller). | |
void | processAll () override |
Processes all requests until the cursors have traversed the whole tree and the queue is empty. | |
void | process (double timeBudget) override |
Process the requests for the given timeBudget given in seconds. | |
bool | needsProcessing () override |
Returns if the tile request needs some more processing. | |
void | append (PageRequest *request) override |
Implements PageRequestQueueInterface interface. | |
bool | processingWasSingleThreaded () const override |
Processing is always single-threaded, only implemented for testing purposes. | |
Public Member Functions inherited from ml::PageRequestProcessorBase | |
PageRequestProcessorBase (Host *host) | |
~PageRequestProcessorBase () override | |
void | removeCancelledRequests () override |
Removes all requests that are canceled and no longer needed. | |
ProcessingTimeLine & | getProcessingTimeLine () |
Get access to the processing time line. | |
ProcessingTimeLine::TimeLine * | getOverviewTimeLine () |
Get access to the overview time line (only if time line profiling is on) | |
void | enableTimeLineProfiling (bool flag) |
Enable/disable time line profiling. | |
bool | isTimeLineProfilingEnabled () const |
Returns if time line profiling is enabled. | |
int | getProcessingScope () const |
Return the current processing scope. | |
void | enterProcessingScope () override |
Enters a recursive processing scope (always called from main thread!) | |
void | leaveProcessingScope () override |
Leaves a recursive processing scope (always called from main thread!) | |
Public Member Functions inherited from ml::PageRequestProcessor | |
~PageRequestProcessor () override | |
Virtual destructor. | |
Public Member Functions inherited from ml::PageRequestQueueInterface | |
virtual | ~PageRequestQueueInterface () |
Virtual destructor to get rid of warning. | |
Additional Inherited Members | |
Static Public Member Functions inherited from ml::PageRequestProcessor | |
static void | enableTileRequestAllocationFailure (int count=1) |
Enables failing on every count allocation. | |
static void | disableTileRequestAllocationFailure () |
Disables allocation failure (default!) | |
Protected Member Functions inherited from ml::PageRequestProcessorBase | |
bool | createMoreWork (bool sleepWhenBlocked, bool *allBlocked=nullptr, MLint pageRequestLimit=100000, MLint *resultPageRequestCount=nullptr) |
Creates more work items, returns true if new work was created. | |
void | setupCurrentProcessingScope () |
helper | |
virtual void | handleErrorsInGUIThread () |
handle all errors that have been accumulated | |
void | terminateAllRequestsInGUIThread () |
terminate all requests | |
void | addNewCursor (PageRequestCursor *cursor) |
add the new cursor | |
virtual void | getAllPageRequestQueues (std::vector< std::deque< PageRequest * > * > &queues) |
get all page request queues (to be derived when there are more than the GUI queues) | |
UserThreadData * | getUserThreadData (PageRequest *request, PerThreadStorage &perThreadStorage) |
Gets or allocates the UserThreadData for the given request as part of the perThreadStorage. | |
Protected Attributes inherited from ml::PageRequestProcessorBase | |
Host * | _host |
optional pointer to the host | |
bool | _terminated |
flag if the calculation was terminated | |
int | _rootTileRequests |
the number of root tile requests, if this gets down to 0, we are done | |
std::vector< std::vector< PageRequestCursor * > > | _cursors |
The cursors that are handled by the producer thread, one list for each processing scope. | |
int | _processingScope |
the current processing scope (0 = BG tasks, 1 = normal get tile, >1 = recursive get tile | |
int | _producerProcessingScope |
the current cursor scope of the producer | |
int | _producerCursorCounter |
how many cursors the producer contains in all lists | |
int | _guiThreadRecursionCounter |
the recursion of the GUI thread (0 = outer entry) | |
ScopeStackEntry * | _currentScope |
the current scope pointer | |
std::vector< ScopeStackEntry > | _scopeStack |
Stack of processing scopes for performance reasons, we only grow this stack, we never shrink it. | |
TimeCounter | _progressUpdateTimer |
Timer used for progress update from GUI thread. | |
PerThreadStorage | _guiPerThreadStorage |
The per thread storage for the GUI thread. | |
bool | _useTimeLineProfiling |
ProcessingTimeLine | _profile |
ProcessingTimeLine::TimeLine * | _guiThreadTimeLine |
ProcessingTimeLine::TimeLine * | _overviewTimeLine |
A single-threaded processor that takes one or even multiple tile requests and can process them iteratively.
Definition at line 27 of file mlSingleThreadedPageRequestProcessor.h.
ml::SingleThreadedPageRequestProcessor::SingleThreadedPageRequestProcessor | ( | Host * | host = nullptr | ) |
|
override |
|
overridevirtual |
Adds the root tileRequest
that should be processed (the ownership stays with the caller).
Implements ml::PageRequestProcessor.
|
overridevirtual |
Implements PageRequestQueueInterface interface.
Implements ml::PageRequestQueueInterface.
|
overridevirtual |
Returns if the tile request needs some more processing.
Implements ml::PageRequestProcessor.
|
overridevirtual |
Process the requests for the given timeBudget given in seconds.
Implements ml::PageRequestProcessor.
|
overridevirtual |
Processes all requests until the cursors have traversed the whole tree and the queue is empty.
Implements ml::PageRequestProcessor.
|
inlineoverridevirtual |
Processing is always single-threaded, only implemented for testing purposes.
Implements ml::PageRequestProcessor.
Definition at line 55 of file mlSingleThreadedPageRequestProcessor.h.
|
inlineoverridevirtual |
Set the number of threads (ignored by this implementation)
Implements ml::PageRequestProcessor.
Definition at line 37 of file mlSingleThreadedPageRequestProcessor.h.
|
inlineoverridevirtual |
Returns if multi-threading is supported.
Implements ml::PageRequestProcessorBase.
Definition at line 34 of file mlSingleThreadedPageRequestProcessor.h.