Hi, Currently JSC doesn't take into account that a native function call can take an arbitrary time to complete. This means that TimeoutChecker::didTimeout() can be called less frequently than desired (see https://bugs.webkit.org/show_bug.cgi?id=38041 for how this also affects the Qt API). Does anyone have ideas other than brute-forcing the check interval to 1? Has using a high-resolution timer in the inner JSC loop been considered? I guess the two-level timeout check (cheap (loop) counter, followed by elapsed time check) was done for performance reasons. The alternatives I see are 1) Replace the two-level check by a single, reasonably precise check based on elapsed time (if this is possible without killing performance); or 2) Provide a way for native function calls to affect the tick counter. 2) could be done by extending the NativeFunction signature to take an unsigned& ticks as argument. Long-running functions would do the timing explicitly, and use a helper function to convert the elapsed time to ticks. Regards, Kent
participants (1)
-
Kent Hansen