MeVisLab Toolbox Reference
|
A multithreaded processor that takes one or even multiple tile requests and can process them iteratively. More...
#include <mlMultiThreadedPageRequestProcessor.h>
Public Member Functions | |
MultiThreadedPageRequestProcessor (Host *host=nullptr) | |
~MultiThreadedPageRequestProcessor () override | |
bool | supportsMultiThreading () override |
Returns whether multithreading is supported. More... | |
void | setNumWorkerThreads (std::size_t threads) override |
Sets number of worker threads. More... | |
void | addRootTileRequest (TileRequest *tileRequest) override |
Adds the root tileRequest that should be processed; the ownership stays with the caller. More... | |
void | processAll () override |
Processes all requests until the cursors have traversed the entire tree and the queue is empty. More... | |
void | process (double timeBudget) override |
Process the requests for the given timeBudget given in seconds. More... | |
void | launchMultiThreading () |
Launches the multithreading. More... | |
bool | needsProcessing () override |
Returns whether the tile request needs some more processing. More... | |
void | append (PageRequest *request) override |
Implements PageRequestQueueInterface interface. More... | |
void | enterProcessingScope () override |
Enters a recursive processing scope. This is always called from main thread! More... | |
void | leaveProcessingScope () override |
Leaves a recursive processing scope. This is always called from main thread! More... | |
bool | processingWasSingleThreaded () const override |
Processing is always single-threaded, implemented only for testing purposes. More... | |
void | setAllowLateMultiThreadingStart (bool flag) |
This can be set to false to debug the single-threaded part of this class. More... | |
![]() | |
PageRequestProcessorBase (Host *host) | |
~PageRequestProcessorBase () override | |
void | removeCancelledRequests () override |
Removes all requests that are canceled and no longer needed. More... | |
ProcessingTimeLine & | getProcessingTimeLine () |
Returns access to the processing timeline. More... | |
ProcessingTimeLine::TimeLine * | getOverviewTimeLine () |
Returns access to the overview timeline (only if timeline profiling is on). More... | |
void | enableTimeLineProfiling (bool flag) |
Enables/disables timeline profiling. More... | |
bool | isTimeLineProfilingEnabled () const |
Returns whether timeline profiling is enabled. More... | |
int | getProcessingScope () const |
Returns the current processing scope. More... | |
void | enterProcessingScope () override |
Enters a recursive processing scope. This is always called from main thread! More... | |
void | leaveProcessingScope () override |
Leaves a recursive processing scope. This is always called from main thread! More... | |
![]() | |
~PageRequestProcessor () override | |
Virtual destructor. More... | |
![]() | |
virtual | ~PageRequestQueueInterface () |
Virtual destructor to get rid of warning. More... | |
Additional Inherited Members | |
![]() | |
static void | enableTileRequestAllocationFailure (int count=1) |
Enables failing on every count allocation. More... | |
static void | disableTileRequestAllocationFailure () |
Disables allocation failure. This is the default! More... | |
![]() | |
bool | createMoreWork (bool sleepWhenBlocked, bool *allBlocked=nullptr, MLint pageRequestLimit=100000, MLint *resultPageRequestCount=nullptr) |
Creates more work items, returns true if new work was created. More... | |
void | setupCurrentProcessingScope () |
Helper. More... | |
void | terminateAllRequestsInGUIThread () |
Terminates all requests. More... | |
void | addNewCursor (PageRequestCursor *cursor) |
Adds the new cursor. More... | |
UserThreadData * | getUserThreadData (PageRequest *request, PerThreadStorage &perThreadStorage) |
Returns or allocates the UserThreadData for the given request as part of the perThreadStorage. More... | |
![]() | |
Host * | _host |
Optional pointer to the host. More... | |
bool | _terminated |
Flag whether the calculation was terminated. More... | |
int | _rootTileRequests |
The number of root tile requests; if this gets down to 0, we are done. More... | |
std::vector< std::vector< PageRequestCursor * > > | _cursors |
The cursors that are handled by the producer thread, one list for each processing scope. More... | |
int | _processingScope |
The current processing scope (0 = BG tasks, 1 = normal get tile, >1 = recursive get tile). More... | |
int | _producerProcessingScope |
The current cursor scope of the producer. More... | |
int | _producerCursorCounter |
How many cursors the producer contains in all lists. More... | |
int | _guiThreadRecursionCounter |
The recursion of the GUI thread (0 = outer entry). More... | |
ScopeStackEntry * | _currentScope |
The current scope pointer. More... | |
std::vector< ScopeStackEntry > | _scopeStack |
Stack of processing scopes. More... | |
TimeCounter | _progressUpdateTimer |
Timer used for progress update from GUI thread. More... | |
PerThreadStorage | _guiPerThreadStorage |
The per-thread storage for the GUI thread. More... | |
bool | _useTimeLineProfiling |
ProcessingTimeLine | _profile |
ProcessingTimeLine::TimeLine * | _guiThreadTimeLine |
ProcessingTimeLine::TimeLine * | _overviewTimeLine |
A multithreaded processor that takes one or even multiple tile requests and can process them iteratively.
Definition at line 45 of file mlMultiThreadedPageRequestProcessor.h.
ml::MultiThreadedPageRequestProcessor::MultiThreadedPageRequestProcessor | ( | 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 |
Enters a recursive processing scope. This is always called from main thread!
Implements ml::PageRequestProcessor.
void ml::MultiThreadedPageRequestProcessor::launchMultiThreading | ( | ) |
Launches the multithreading.
|
overridevirtual |
Leaves a recursive processing scope. This is always called from main thread!
Implements ml::PageRequestProcessor.
|
overridevirtual |
Returns whether 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 entire tree and the queue is empty.
Implements ml::PageRequestProcessor.
|
inlineoverridevirtual |
Processing is always single-threaded, implemented only for testing purposes.
Implements ml::PageRequestProcessor.
Definition at line 81 of file mlMultiThreadedPageRequestProcessor.h.
|
inline |
This can be set to false
to debug the single-threaded part of this class.
Definition at line 84 of file mlMultiThreadedPageRequestProcessor.h.
|
overridevirtual |
Sets number of worker threads.
Implements ml::PageRequestProcessor.
|
inlineoverridevirtual |
Returns whether multithreading is supported.
Implements ml::PageRequestProcessorBase.
Definition at line 52 of file mlMultiThreadedPageRequestProcessor.h.