I'd asked a very similar question earlier, but the project scope is quickly growing beyond where signals can get me (I think). Basically, my program will be doing stuff on three different intervals; one function every 15 seconds, one function at a configurable interval (5 to 60 seconds, generally), and one function every hour or two.
From an intuitive standpoint, it seems like multiple signal.signal() calls with separate functions wouldn't get me very far: an ITIMER_REAL timer only issues one signal -- SIGALRM, and thus there would be no way to differentiate which itimer is issuing the signal. Since the 15-second interval function needs to run regardless of what might be going on with the other functions, this leaves me with the choice of multithreading or multiprocessing.
I'm leaning towards multiprocessing, in hopes I can just spawn three child processes, each with their own signal/itimer intervals, and let them each do their work at their leisure. Is this feasible? If not, what would be the best way to have these three functions run at their desired intervals?