Understanding the Event-Loop in node.js -


i've been reading lot event loop, , understand abstraction provided whereby can make i/o request (lets use fs.readfile(foo.txt)) , pass in callback executed once particular event indicating completion of file reading fired.

however, not understand function doing work of reading file being executed. javascript single-threaded, there 2 things happening @ once: execution of node.js file , of program/function reading data harddrive. second function take place in relation node?

"of course, on backend, there threads , processes db access , process execution. however, these not explicitly exposed code, can’t worry them other knowing i/o interactions e.g. database, or other processes asynchronous perspective of each request since results threads returned via event loop code. compared apache model, there lot less threads , thread overhead, since threads aren’t needed each connection; when absolutely positively must have else running in parallel , management handled node.js." via http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -