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 f3f49d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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 f3f49d2

Please sign in to comment.