Your description is conflicting. You say that phase_1 objects need to be collected as soon as possible, yet phase_1 can be around 30 seconds.
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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.