On 09/07/2011 01:04 PM, Stas Malyshev wrote:
> Hi!
> 
> On 9/7/11 12:43 PM, Rasmus Lerdorf wrote:
>> Actually, it seems to be more than that. That set_time_limit() just
>> speeds up the test. Since we have a default max_execution_time you
>> should still have hit that and the shutdown function should have been
>> called. But your other max_execution_time-related tests, like 045 pass,
>> so what is special about this one? The tight for(;;) loop?
> 
> setitimer exists just fine on Darwin, but the tight loop seems to be the
> problem - if I put echo time(); in the loop, it exits in prescribed
> time. Without it, it runs forever. Actually, just time() without echo
> seems to be enough - looks like any system calls make it work, but tight
> loop doesn't.

Interesting that this is different on Darwin. That doesn't seem like
something that should be OS-specific unless Darwin's itimer
implementation is messed up.

On Linux the SIGPROF itimer is documented like this:

ITIMER_PROF decrements both when the process executes and when the
system is executing on behalf of the process.  Coupled with
ITIMER_VIRTUAL, this timer is usually used to profile the time spent by
the application in user and kernel space.  SIGPROF is delivered upon
expiration.

There is nothing about a tight PHP loop that should cause an itimer like
that to not decrement and send a SIGPROF when it expires.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to