Skip to content

Commit

Permalink
replace c++ deque with vector for event queue
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Jul 26, 2024
1 parent 23dc955 commit c9584cf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,17 @@ jobs:
# echo "------ running ziptool ------"
# ./bin/ziptool || true

- 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: 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: Build Windows
if: matrix.platform == 'windows-latest'
Expand Down
4 changes: 2 additions & 2 deletions VCellMessaging/include/VCELL/SimulationMessaging.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _SIMULATIONMESSAGING_H_
#define _SIMULATIONMESSAGING_H_

#include <deque>
#include <vector>
#ifdef USE_MESSAGING
#include <stdlib.h>
#include <stdio.h>
Expand Down Expand Up @@ -145,7 +145,7 @@ class SimulationMessaging
private:
SimulationMessaging();
static SimulationMessaging *m_inst;
std::deque<WorkerEvent *> events;
std::vector<WorkerEvent *> events;
int workerEventOutputMode;

void sendStatus();
Expand Down
5 changes: 4 additions & 1 deletion VCellMessaging/src/SimulationMessaging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c9584cf

Please sign in to comment.