You'll need a watchdog thread that handles the other threads. The watchdog thread just builds a table of when threads were started, and after a certain # of seconds, expires those threads and kills them.