Another approach to timeout handling

From: Date: Fri, 29 Aug 2008 07:08:53 +0000
Subject: Another approach to timeout handling
Groups: php.internals 
Request: Send a blank email to internals+get-40125@lists.php.net to get a copy of this message
Hi, This is simple, fast and system independent solution for safe timeout handling. The patch does the same as "Zend Signal Handling" and it does it safer (correct me if I'm wrong). The signal handler just set EG(timed_out) flag (as on Windows). This flag is checked during execute() loop, but only on instructions that may cause loops (jmp(s) and function call). The slowdown because of additional checks is near invisible (0.5% on bench.php according to valgrind). The only disadvantage is inability to terminate internal functions, but each such termination may be unsafe and cause future memory corruptions, crashes, memory and resource leaks. I don't persist to include it in 5.3, as it need to be discussed and may delay release. (Personally, I'm irrelevant if it committed or not) It just an illustration of another simple approach. Thanks. Dmitry.

« previous php.internals (#40125) next »