node. JS learning One--what is node. js

Source: Internet
Author: User

Definition: node. js is a JavaScript running platform running on the server side using the Google V8 engine

Features: 1. asynchronous I/O (non-blocking I/O) 2. Event-driven

What is asynchronous I/O (non-blocking I/O)?

To understand what asynchronous I/O is (non-blocking I/O), you must first understand what I/O, what is blocking, and what is synchronous I/O (blocking I/O).

Definition of I/O: threads are collectively referred to as I/O operations when performing disk reads or writes or network traffic.

Blocking definition: In the process of I/O, the operating system deprives the thread of control of the CPU and causes the thread to suspend execution because it takes a long time to take. At the same time, the resources to other threads, such a scheduling method called blocking.

Blocking I/O: When the I/O operation is complete, the operating system relieves the blocking state of the thread, restores its control over the CPU, and lets him continue execution. This I/O mode is called synchronous I/O or blocking I/O.

asynchronous I/O: Compared to synchronous I/O, the asynchronous I/O does not take a blocking policy on processing I/O scheduling, that is, I am not waiting for I/O completion or return of results, but I am sending the I/O request to the operating system, I continue to execute it, wait until I/O is complete and then notify the i/ o The thread of the operation,

Threads handle events at specific times. In order to be able to implement a thread that can notify a previous I/O operation, the thread must have a loop check for a new event mechanism, which should be processed once a new event is available.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.