87 struct WorkerThreadState;
90 bool processNextGUIRequest(
int millisecondsToWait);
93 void processNextWorkerRequest(WorkerThreadState* state, PerThreadStorage& perThreadStorage);
99 static void rootTileRequestFinishedCB(
void* data,
TileRequest* request);
102 void rootTileRequestFinished(
TileRequest* request);
105 void runPageRequestProducerLoop();
108 void addNewCursors();
111 void runWorkerThreadLoop(WorkerThreadState* state);
114 void notifyAllThreads();
117 void launchWorkerThreads();
120 int getCurrentNumberOfPageRequestsInQueues();
123 void wakeupProducerIfWaitingForQueue();
129 void stopProcessingOnAllThreads();
132 void moveRequestsFromGUIQueuesToOtherQueues();
138 void startCreatingWorkSingleThreaded();
144 bool _producerWorking;
146 int _workerThreadsWorking;
149 int _maxPageRequestsInQueues;
152 bool _producerWaitingForQueue;
155 bool _processingAllowed;
157 bool _useMultiThreading;
158 bool _processingWasSingleThreaded;
159 bool _allowLateMultiThreadingStart;
174 std::vector<PageRequestCursor*> _newCursors;
177 std::deque<PageRequest*> _parallelWorkQueue;
178 std::deque<PageRequest*> _ioWorkQueue;
181 struct WorkerThreadState
184 ~WorkerThreadState();
187 boost::thread* _thread;
199 std::deque<PageRequest*>* _queue;
209 std::size_t _numDesiredWorkerThreads;
212 std::vector<WorkerThreadState*> _workerThreads;
215 WorkerThreadState* _ioThread;
218 boost::thread* _producerThread;
221 ProcessingTimeLine::TimeLine* _producerThreadTimeLine;
224 struct ProfilingInfo {
238 std::map<PagedImage*, ProfilingInfo> _profilingData;
241 void addThreadTimesToMLProfiling();