Skip to content
Snippets Groups Projects

Feature/forgetting in wm and em

Merged Fabian Tërnava requested to merge feature/forgetting-in-wm-and-em into master
Compare and Show latest version
6 files
+ 29
40
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -38,32 +38,7 @@ namespace armarx::armem::server::ltm::detail::mixin
void
bufferFinished()
{
ARMARX_INFO << "Saving data in files...";
while (!(buffer->empty()))
{ //wait until buffer is empty
ARMARX_INFO << deactivateSpam()
<< "Writing data to files, please do not stop this component";
sleep(5); //do not test too often
}
/*
sleep(30);
ARMARX_INFO << "Test";
bool store = storeFlag.test_and_set();
storeFlag.clear();
while (store)
{ //and then wait until the store_buffer was emptied, indicated by the store flag
ARMARX_INFO
<< deactivateSpam()
<< "Writing data from memory to files, pleaso do not stop this component";
sleep(2);
store = storeFlag.test_and_set();
storeFlag.clear();
}
sleep(5); //make sure last buffer was also written
ARMARX_IMPORTANT << "All buffers empty, all information stored on disk. You can stop "
"this component now";
*/
//use this to count how much work is still left
}
protected:
@@ -99,6 +74,7 @@ namespace armarx::armem::server::ltm::detail::mixin
task->stop();
task = nullptr;
}
}
armem::wm::Memory
@@ -128,13 +104,8 @@ namespace armarx::armem::server::ltm::detail::mixin
{
std::this_thread::yield();
}
std::thread storingThread(
[&]
{
this->directlyStore(*to_store);
storeFlag.clear(std::memory_order_release);
});
storingThread.detach();
this->directlyStore(*to_store);
storeFlag.clear(std::memory_order_release);
}
/// configuration
Loading