Multiple subprocesses with timeouts
问题 I'm using a recipe that relies on SIGALRM to set alarm interrupt -- Using module 'subprocess' with timeout The problem is that I have more than one Python script using signal.ALARM process to set time-outs, and only the latest alarm gets called. What is a good way to improve this multiple Python functions setting time-outs? 回答1: Except for simple, quick hacks, avoid SIGALRM. It's a very old, limited mechanism, not suited to anything more complex: you can only set a single alarm, and it