Skip to content

Commit ff8363c

Browse files
committed
Testing idea for #687
1 parent cbb53b3 commit ff8363c

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/Dataflow/Network/Network.cc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,16 @@ void Network::setModuleExecutionState(ModuleInterface::ExecutionState state, Mod
233233
};
234234

235235
//TODO: possible fix for network execute delay. Need to test with users.
236-
//boost::thread t(update);
237-
// for now, just run in this thread
238-
update();
236+
if (settings().value("networkStateUpdateThread") == "yes")
237+
{
238+
boost::thread t(update);
239+
std::cout << "threaded state update" << std::endl;
240+
}
241+
else // for now, just run in this thread
242+
{
243+
update();
244+
std::cout << "non-threaded state update" << std::endl;
245+
}
239246
}
240247

241248
void Network::clear()

src/Interface/Application/NetworkEditor.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <Dataflow/Engine/Controller/NetworkEditorController.h> //TODO: remove
4545
#include <Dataflow/Network/NetworkSettings.h> //TODO: push
4646
#include <Core/Application/Preferences/Preferences.h>
47+
#include <Core/Application/Application.h>
4748
#ifdef BUILD_WITH_PYTHON
4849
#include <Dataflow/Engine/Python/NetworkEditorPythonAPI.h>
4950
#endif
@@ -127,6 +128,10 @@ void NetworkEditor::setNetworkEditorController(boost::shared_ptr<NetworkEditorCo
127128

128129
connect(controller_.get(), SIGNAL(connectionAdded(const SCIRun::Dataflow::Networks::ConnectionDescription&)),
129130
this, SLOT(connectionAddedQueued(const SCIRun::Dataflow::Networks::ConnectionDescription&)));
131+
132+
//TODO: duplication
133+
const std::string value = Application::Instance().parameters()->entireCommandLine().find("--testUpdateThread") != std::string::npos ? "yes" : "no";
134+
controller_->getSettings().setValue("networkStateUpdateThread", value);
130135
}
131136
}
132137

@@ -818,6 +823,10 @@ SCIRun::Dataflow::Networks::NetworkFileHandle NetworkEditor::saveNetwork() const
818823
void NetworkEditor::loadNetwork(const SCIRun::Dataflow::Networks::NetworkFileHandle& xml)
819824
{
820825
controller_->loadNetwork(xml);
826+
827+
//TODO: duplication
828+
const std::string value = Application::Instance().parameters()->entireCommandLine().find("--testUpdateThread") != std::string::npos ? "yes" : "no";
829+
controller_->getSettings().setValue("networkStateUpdateThread", value);
821830
}
822831

823832
size_t NetworkEditor::numModules() const

0 commit comments

Comments
 (0)