Commit d981074a authored by Martin Karsten's avatar Martin Karsten
Browse files

- reset idle manager stats after fork

parent e5917993
......@@ -27,7 +27,9 @@ In addition, the following students (in alphabetical order) have helped with var
- Qin An (FreeBSD/kqueue)
- Bilal Akhtar (gdb extension)
- Peter Cai (bug fixes)
- Peng Chen (split stack)
- Bryant Curto (bug fixes)
- Peiran Hong (API/Apache)
- Matthew May (MCS queue with timeout)
- Wen Shi (gdb extension)
......
......@@ -104,6 +104,7 @@ void Cluster::preFork(_friend<EventScope>) {
void Cluster::postFork(cptr_t parent, _friend<EventScope> fes) {
new (stats) FredStats::ClusterStats(this, parent);
idleManager.reset(this, fes);
for (size_t p = 0; p < iPollCount; p += 1) {
iPollVec[p].~PollerType();
new (&iPollVec[p]) PollerType(scope, stagingProc, this, "I-Poller ", _friend<Cluster>());
......
......@@ -64,6 +64,10 @@ class IdleManager {
public:
IdleManager(cptr_t parent) : fredCounter(0) { stats = new FredStats::IdleManagerStats(this, parent); }
void reset(cptr_t parent, _friend<EventScope>) {
new (stats) FredStats::IdleManagerStats(this, parent);
}
bool tryGetReadyFred() {
ssize_t c = fredCounter;
return (c > 0) && __atomic_compare_exchange_n(&fredCounter, &c, c-1, false, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
......@@ -92,6 +96,7 @@ public:
class IdleManager {
public:
IdleManager(cptr_t) {}
void reset(cptr_t, _friend<EventScope>) {}
};
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment