On Fri, Nov 8, 2013 at 5:29 PM, Ilya Shaisultanov <
ilya.shaisulta...@gmail.com> wrote:

> Ok, I think I'm thinking about process.nextTick as it was in node <0.10,
> where, if I'm not mistaken
>
> function f() {
>   process.nextTick(f)
> }
>
> f()
>
> would loop infinitely, whereas an immediate recursive call throws
> RangeError.
>
> I tried running that in v0.10 and got RangeError. However,
>
> function f() {
>   setImmediate(f)
> }
>
> f()
>
> puts the function in "background" and makes node process consume 100% CPU.
> What happens there?
>


I believe this is a bug that's specific to  0.10.x and was fixed in 0.11.x
and up. (Sorry, I don't have free cycles to look up the relevant github
issues at the moment)

Rick


> On Friday, November 8, 2013 5:20:21 PM UTC-5, Rick Waldron wrote:
>
>>
>>
>>
>> On Fri, Nov 8, 2013 at 3:57 PM, Ilya Shaisultanov 
>> <ilya.sha...@gmail.com>wrote:
>>
>>> Pardon for resurrecting such old thread but I have a question about
>>> process.nextTick: why/how does it eliminate the current stack? What happens
>>> behind the scenes?
>>>
>>
>> It doesn't eliminate the current stack. The callback is "scheduled" and
>> subsequently executed in the next execution turn.
>>
>> Rick
>>
>>
>>  --
> --
> 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
>
> ---
> 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 nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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

--- 
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 nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to