From 37112a5636f29db25e4329bea79429f9b7fd65b4 Mon Sep 17 00:00:00 2001 From: jcschaff Date: Fri, 26 Jul 2024 14:44:08 -0400 Subject: [PATCH] replace c++ deque with vector for event queue --- .github/workflows/cd.yml | 30 ++++++++++++++----- .../include/VCELL/SimulationMessaging.h | 4 +-- VCellMessaging/src/SimulationMessaging.cpp | 5 +++- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index dd13abec..dc3581d2 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -289,20 +289,34 @@ jobs: # echo "------ running ziptool ------" # ./bin/ziptool || true - - name: Setup Visual Studio build tools +# - name: Setup Visual Studio build tools +# if: matrix.platform == 'windows-latest' +# uses: actions/vs-build-tools@v1 +# with: +# installPath: C:\BuildTools +# version: 16 +# components: Microsoft.VisualStudio.Component.VC.Tools.x86.x64 +# +# - name: Add clang-cl to PATH +# if: matrix.platform == 'windows-latest' +# run: echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\bin" >> $GITHUB_PATH + + - name: Install Windows Dependencies if: matrix.platform == 'windows-latest' - uses: actions/vs-build-tools@v1 + uses: msys2/setup-msys2@v2 with: - installPath: C:\BuildTools - version: 16 - components: Microsoft.VisualStudio.Component.VC.Tools.x86.x64 + msystem: MINGW64 + update: true + install: > + zip + git + cmake + ninja - - name: Add clang-cl to PATH - if: matrix.platform == 'windows-latest' - run: echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\bin" >> $GITHUB_PATH - name: Build Windows if: matrix.platform == 'windows-latest' + shell: msys2 {0} run: | echo "working dir is $PWD" diff --git a/VCellMessaging/include/VCELL/SimulationMessaging.h b/VCellMessaging/include/VCELL/SimulationMessaging.h index 20979cce..3180e211 100644 --- a/VCellMessaging/include/VCELL/SimulationMessaging.h +++ b/VCellMessaging/include/VCELL/SimulationMessaging.h @@ -1,7 +1,7 @@ #ifndef _SIMULATIONMESSAGING_H_ #define _SIMULATIONMESSAGING_H_ -#include +#include #ifdef USE_MESSAGING #include #include @@ -145,7 +145,7 @@ class SimulationMessaging private: SimulationMessaging(); static SimulationMessaging *m_inst; - std::deque events; + std::vector events; int workerEventOutputMode; void sendStatus(); diff --git a/VCellMessaging/src/SimulationMessaging.cpp b/VCellMessaging/src/SimulationMessaging.cpp index 4747cb85..5537ff49 100644 --- a/VCellMessaging/src/SimulationMessaging.cpp +++ b/VCellMessaging/src/SimulationMessaging.cpp @@ -155,7 +155,10 @@ void SimulationMessaging::sendStatus() { WorkerEventLocker locker(*this); if (events.size( ) > 0 ) { workerEvent = events.front( ); - events.pop_front( ); + if (!events.empty()) + { + events.erase(events.begin()); + } } else { return;