node. js this thing in recent years fire up, and will continue to fire, whether in Infoq or CNBLOGS,CSDN, can be seen everywhere it looks, it is the main push is the asynchronous I/O bar, yes, the design is perfect, very attractive, although it is different from normal thinking, But when you really know it, it will be enough to make you fall in love with it! node. js really changed my concept of programming and changed my understanding of computer systems!
If the celebrity concludes, we should have a hundreds of-time aftertaste.
synchronous I/O: If a thread encounters disk read-write or network traffic (collectively referred to as I/O operations) during execution, it usually takes a long time for the operating system to deprive the thread of CPU control to suspend execution (blocking the remaining work in the current thread, and when the time-consuming operation is complete, To continue executing the rest of the code) and to give the resource to other worker threads, which is called blocking. When the I/O operation is complete, the operating system relieves the blocking state of the thread and restores its control over the CPU to continue execution. This I/O pattern is the usual synchronous I/O (synchronous I/O).
asynchronous I/O: When a thread encounters an I/O operation, it does not block the completion of the I/O operation or the return of the data, but simply sends the I/O request to the operating system and proceeds to the next statement. When the operating system completes an I/O operation, the thread that notifies the I/O operation as an event is handled by the thread at a particular time. To handle asynchronous I/O, threads must have an event loop, constantly checking for unhandled events, and then processing them sequentially. (There is an event queuing mechanism, which is always rotation, and when there is an event to be handled, it handles the callback method of the event)
Perfect event polling mechanism, change the way the program runs, change the programmer's thinking!
node. JS Tutorial Series ~ Catalog
Nodejs Instance Series ~ Directory
Environment building, Hello World return!
The patterning of node. js
node. js Event mechanism
The asynchronous I/O mechanism for node. js
Introduction to node. JS's Connect module
node. js with MongoDB
node. js and Redis
node. js and SQL Server
Permanent update in ...
node. JS Tutorial Series ~ Catalog