Warning: session_start(): open(/var/lib/php/sessions/sess_aj7s8194qk5h2vjildq7uno4aq, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
set flag LeanMode. set flag OurSyncCollections.
sbool ping() { ret ping_v3(); }
static simplyCached PingSource pingSource() { ret new PingSource; }
static double coresToUse = .5;
static new BoolVar on;
static volatile long result;
static NotTooOften nto = nto(1.0);
p/*-exp*/ { // exp for "experiment" automatically reloads on updates
new Schedule schedule;
//enableScaffolding(schedule);
schedule.add(0, r {
dontprint("on");
pingSource.action(null);
on.set();
});
schedule.add(coresToUse, r {
dontprint("off");
on.unset();
pingSource.action(-> {
temp tempPingPrivileged();
on.waitUntilTrue();
true;
});
});
schedule.jumpFromTo(1, 0);
schedule.speedUp(10);
printStruct(schedule);
thread "Counting" {
long i = 0;
var ping = pingSource();
while (true) {
ping?!;
if (on!)
++i;
else {
result = i;
on.waitUntilTrue();
if (nto!) print("I have counted until " + n2(i) + ". pid=" + pid());
}
}
}
schedule.run();
}