I was already guessing something like that (uv_loop_t definition), because 
setting all intervals to 0.5 sec... 
Why the pool size is 4; is it a pragmatic choice?

My workaround is to create only one timerfd with a fixed 1 sec interval 
(much more accurate than setInterval, no drift, and does not go crazy on 
system time changes).
The callback executes an array with callback functions and intervals that 
are a multitude of 1 sec.

On Wednesday, May 7, 2014 6:05:12 PM UTC+2, Ben Noordhuis wrote:
>
> On Wed, May 7, 2014 at 2:01 PM, Kees k <[email protected] <javascript:>> 
> wrote: 
> > Hello all, 
> > 
> > I have a difficulty with integrating timerfd worker threads with another 
> > worker thread. Basically my app has two types of external threads: 
> > 1. worker thread that sleeps 10 ms ('does some blocking task') and 
> returns 
> > 2. worker thread that is polls a timerfd and returns. 
> > 
> > The difficulty starts only when I create more than three timers 
> (TIMERFDS > 
> > 3): 
> > 1. The worker thread that sleeps only returns after 1 second instead of 
> 10 
> > ms. 
> > 2. timers work fine. 
>
> That's because your tasks are clogging the thread pool.  It's 
> currently of a fixed size and it probably won't come as a surprise 
> that said size is 4.  (You're probably wondering why.  It's 
> complicated.) 
>
> There are two things you can do: 
>
> 1.  `env UV_THREADPOOL_SIZE=32 node app.js` 
>
> 2. Create your own threads with uv_thread_create(). 
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/7e86923c-745b-41b8-beed-725188270027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to