Use a queue instead of spawning and killing threads.