>
> We had to change some calls to accept a
> callback, and then it would call the callback inside a
> process.nextTick(). That made the code async, and the problem
> disappeared.


Just to clarify in case anyone gets confused by this,  nextTick does not
many anything parallel.  Node is single threaded and nextTick
doesn't magically change that.  All it does if defer some work till a later
tick.  The body of your callback will still block the CPU when it gets
called.  If anything this will use more CPU overall because of managing the
nextTick queue and calling extra callbacks.

process.nextTick was not made for this use case, it sortof works currently
because of an implementation bug that sometimes lets other events in before
the nextTick fires.  What's really needed is either true parallel work
using threads/processes or an idle event that you can feed units of work.


On Wed, Jun 6, 2012 at 9:12 AM, Ben Noordhuis <i...@bnoordhuis.nl> wrote:

> On Wed, Jun 6, 2012 at 5:42 AM, Tim Dickinson <price.ti...@gmail.com>
> wrote:
> > Thats not what im asking about. There are no while loop, my for loops
> even
> > use the nextTick. I need to know what kind of delay there is, not if the
> > code is blocking. The longer the delay the more work has been quoted.
>
> Do I need to point out that you, the OP, picked "Event loop blocking.
> How to detect?" as the subject of this topic?
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> 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 post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
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 post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to