Does recursive process.nexttick use the use of other processes or threads?

Technically, when we execute the following code (recursive process.nexttick), the processor load will be 100% or almost. The question is that I start the machine with one processor and another process of the HTTP node server works there, how does it affect it?

Does the thread create a recursive process.nexttick that allows the HTTP server to work at all?

If we have two threads of a recursive process. Unlike, they both get a 50% stake?

Since I do not know which machine with one core can not try. And since in this case my understanding of the separation of time between processors between threads is limited, I am not trying to use it with machines with 4 processor cores.

function interval(){
  process.nextTick(function(){
    someSmallSyncCode();
    interval();  
  })
} 

thank

+5
2

, , node, .

, . , ?

, , ( ), "" , .

, ( ), , .

process.nextTick , . , , . , , . "" , .

, ?

, , . process.nextTick , , - , ( ). , , HTTP- , script,

function interval(){
  process.nextTick(doIntervalStuff) 
}

function doIntervalStuff() {
  someSmallSyncCode();
  interval();
}

http.createServer(function (req, res) {
 doHTTPStuff()
}).listen(1337, "127.0.0.1");

? , , , .

process.nextTick, doIntervalStuff "" , , - HTTP- (, ), , , - node, . , , , , "", , process.nextTick . (, ), , .

() , ?

, "" . , - (, node, ), , , ( ), , . - , , , node, , ", , node, , .

, node , 100% , , , . , , - , .

node, .nextTick, , , node ( , , , ).

, , , , . process.nextTick, , , - 5 , setTimeout process.nextTick .

, : D

+12

. , , . , process.nextTick , .

+1

All Articles