Re: [v8-users] Limit execution time to 1ms

2019-07-17 Thread Jaka Jančar
Figured out my problem. I was using the CPU clock, and that has ~6ms granularity when used with the timer, I'm guessing it doesn't fire until the task is preempted and the CPU time tallied up. On Tue, Jul 16, 2019 at 13:38 Ben Noordhuis wrote: > On Tue, Jul 16, 2019 at 2:29 PM Jaka Jančar wrote

Re: [v8-users] Limit execution time to 1ms

2019-07-16 Thread Ben Noordhuis
On Tue, Jul 16, 2019 at 2:29 PM Jaka Jančar wrote: > > On the motivation: I have user-provided (synchronous, relatively simple) > snippets of code that run 1k+ times/second on a server and must execute very > predictably and fast or they can affect the rest of the system/users. > > I'm using tim

Re: [v8-users] Limit execution time to 1ms

2019-07-16 Thread Jaka Jančar
On the motivation: I have user-provided (synchronous, relatively simple) snippets of code that run 1k+ times/second on a server and must execute very predictably and fast or they can affect the rest of the system/users. I'm using timer_create() with SIGEV_THREAD indeed (so not really managing m

Re: [v8-users] Limit execution time to 1ms

2019-07-16 Thread Ben Noordhuis
On Tue, Jul 16, 2019 at 1:43 AM Jaka Jančar wrote: > Hi, > > Is there any way to limit execution time to 1ms? Calling timer_create() and > RequestTermination() from another thread is ok for double-digit timeouts, but > not high resolution enough for single digit ones. Is there some callback on