About I/O multiplexing:I/O multiplexing (also known as "event-driven"), the first thing to understand is that the operating system provides you with a feature that can give you a notification when one of your sockets is readable or writable. This
analysis of high performance IO model
Server-side programming often requires the construction of a high-performance IO model, with four of common IO models:
(1) Synchronous blocking IO (Blocking io): The traditional IO model.
(2) Synchronous
1 select function
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);1.1 parameter description the first parameter NFDs is the maximum descriptor value added to the fdset set by 1. fdset is
Socket Programming
The word socket can represent a number of concepts, in the TCP/IP protocol "IP address + TCP or UDP port number" uniquely identify a process in network communications, "IP + port number" is called the socket. In the TCP protocol,
Select and poll FunctionsIn the previous chapter, we encountered a problem that the client was blocked from reading data from the standard input. At the same time, the server required to close the connection for some reason and sent a fin to the
I/O modelBefore starting the study of NIO, there is an understanding of the I/O model, which is absolutely beneficial to the study of NIO. I draw a diagram that simply represents the process of moving data from an external disk to the memory area of
1. Use the Select function as a timerit_value.tv_sec = 0;It_value.tv_usec = 100000;Select (1,null,null,null,&it_value);The above code does not return immediately but waits for 100ms, can be used as a timer, and is more accurate than sleep.2, the
Fd_zero,fd_isset These are all nested words combined with Operation macrosLook at the Select function on MSDN, which is the core of the Select IO model to manage the socket IO and avoid innocent locking.int select (int nfds,fd_set FAR *readfds,
From: http://hi.baidu.com/bimufo/item/139700e4d880cba1c00d755c
The select function is used in non-blocking scenarios. When a socket or a set of sockets have signals, the system provides the select function to achieve multiplexing of input/output
Five I/O modes:[1] blocking I/O[2] non-blocking I/O[3] I/O multiplexing[4] signal-driven I/O (sigio)[5] asynchronous I/O
Generally, there are two steps for a program to input data:1. Wait for data to be read2. Copy data from the system kernel to the
I. Select
In Winsock # include
Prototype
IntSelect ( IntNFDs,Fd_set *Readfds,Fd_set *Writefds,Fd_set *Exceptfds,Const struct timeval *Timeout);
NFDs: this parameter is ignored and only works for compatibility.Readfds: (optional) pointer pointing to
Five I/O modes-blocking (default IO mode), non-blocking (common language pipeline), I/O multiplexing (IO multiplexing scenario), signal I/O, asynchronous I/OFive I/O modes:"1" Blocking I/O (I/O operations under Linux are blocking I/O by default,
Note: This article is a lot of blog learning and summary, there may be an understanding error. Please take a skeptical look at the same time if there are mistakes to be pointed out. What is the difference between synchronous IO and asynchronous Io,
What is the difference between synchronous IO and asynchronous Io, what is blocking IO and non-blocking IO respectively? The answers given by different people in different contexts are different. So first limit the context of this
Http://blog.csdn.net/lb85858585/article/details/6693458Differences between synchronous/asynchronous mode and blocking/non-blocking mode
I like to explain some concepts by connecting to some phenomena in real life in my own language. When I can do
Select Model Principle
Use the select function to determine whether data exists on the socket or whether data can be written to a socket. The purpose is to prevent the application from calling Recv (or send) to receive data from a socket without
Select Model Principle
Use the select function to determine whether data exists on the socket or whether data can be written to a socket. The purpose is to prevent the application from calling Recv (or send) to receive data from a socket without
I have just taken a look at the relevant knowledge of the I/O model and made a summary to share with you.
The selct model refers to the operation in the socket set fd_set (multiple sockets can be connected together to form a socket set)
The socket
Winsock provides some I/O models to help applications manage I/O asynchronously on one or more socket words.
There are about 6 types: Blocking model, select model, wsaasyncselect model, wsaevenetselect model, overlap model, and complete port
Note: This article is a lot of blog learning and summary, there may be an understanding error. Please take a skeptical look at the same time if there are mistakes to be pointed out. What is the difference between synchronous IO and asynchronous Io,
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