Skip to content

Commit

Permalink
Run the dispatcher logic in a worker thread
Browse files Browse the repository at this point in the history
  • Loading branch information
csciguy8 committed Nov 7, 2023
1 parent d4eba7a commit 30896c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ class RequestDispatcher {
RequestDispatcher(
CesiumAsync::AsyncSystem asyncSystem,
std::shared_ptr<CesiumAsync::IAssetAccessor> pAssetAccessor)
: _requestThreadPool(1),
_asyncSystem(asyncSystem),
: _asyncSystem(asyncSystem),
_pAssetAccessor(pAssetAccessor) {}
~RequestDispatcher() noexcept;

Expand Down Expand Up @@ -101,8 +100,6 @@ class RequestDispatcher {
int _maxSimultaneousRequests = 8;
std::map<Tile*, TileLoadWork> _requestsInFlight;

CesiumAsync::ThreadPool _requestThreadPool;

CesiumAsync::AsyncSystem _asyncSystem;

std::shared_ptr<CesiumAsync::IAssetAccessor> _pAssetAccessor;
Expand Down
2 changes: 1 addition & 1 deletion Cesium3DTilesSelection/src/Tileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,7 @@ void RequestDispatcher::WakeIfNeeded() {
_dispatcherIdle = false;
}

_asyncSystem.runInThreadPool(this->_requestThreadPool, [this]() {
_asyncSystem.runInWorkerThread([this]() {
const int throttleTimeInMs = 50;
auto sleepForValue = std::chrono::milliseconds(throttleTimeInMs);

Expand Down

0 comments on commit 30896c1

Please sign in to comment.