in reply to Multialarm loop
Waiting 30 seconds before garbage collecting something is nowadays a really long time.
Timers are a way to go, either using SIGALRM or with an event loop (select, and I think POE can do the hard stuff for you) if you're willing to wait at least 30 seconds.
But if objects need to be destroyed either as soon as possible, or "when the system can", you need more than timers. You also need notification an object is available for garbage collection (and hence, likely coorperation from the other program), and for your phase_2 objects, some system monitoring - to be able to spot whatever "when the system can" means.
For phase_3 objects, it seems that garbage collecting them once every 8 hours is enough (30 * 10 * 100 seconds is 8h20m). I'd use cron for that.
|
|---|