Skip to content
Snippets Groups Projects
Commit c2a8a76f authored by Eric Cano's avatar Eric Cano
Browse files

WIP: partial implementation of garbage collector

parent e0b1c654
No related branches found
No related tags found
No related merge requests found
...@@ -159,11 +159,30 @@ private: ...@@ -159,11 +159,30 @@ private:
i != intendedObjects.end(); i++) { i != intendedObjects.end(); i++) {
switch (i->objectType) { switch (i->objectType) {
case serializers::RecallFIFO_t: case serializers::RecallFIFO_t:
// We need to check that this recall FIFO is plugged in the job pool
// structure
{
RootEntry re(m_agent);
JobPool jp(re.getJobPool(m_agent), m_agent);
if (i->name != jp.getRecallFIFO(m_agent))
m_agent.objectStore().remove(i->name);
break; break;
}
case serializers::RecallJob_t: case serializers::RecallJob_t:
{
// The recall job here can only think of on FIFO it could be in. This
// will be more varied in the future.
RecallJob rj(i->name, m_agent);
FIFO RecallFIFO(rj.owner(m_agent), m_agent);
// We repost the job unconditionally in the FIFO. In case of an attempted
// pop, the actual ownership (should be the FIFO) will be checked by
// the consumer. If the owner is not right,
break; break;
}
case serializers::JobPool_t: case serializers::JobPool_t:
{
break; break;
}
} }
} }
} catch (...) {} } catch (...) {}
......
...@@ -39,6 +39,13 @@ public: ...@@ -39,6 +39,13 @@ public:
updateFromObjectStore(rjs, agent.getFreeContext()); updateFromObjectStore(rjs, agent.getFreeContext());
return rjs.destination(); return rjs.destination();
} }
std::string owner(Agent & agent) {
serializers::RecallJob rjs;
updateFromObjectStore(rjs, agent.getFreeContext());
return rjs.owner();
}
}; };
}} }}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment