IO model1, blocking IO2, non-blocking IO3, multiplexing IO4, asynchronous IOOne, blocking IOThe blocking IO is characterized by a block of two phases of IO execution (two stages of waiting for data and copying data).Virtually all IO interfaces (including the socket interface) are blocking, unless specifically specified
encounters an IO operation to automatically switch to another coprocessor
A small example of a process manually switching IO operations
Greenlet is a C implementation of the process module compared to the yield of Python and it can allow you to arbitrarily switch between any function without the need to declare this function as generator
Import Greenlet def test1 (): print (All) g2.switch () print
Basic Java IO knowledge (I)Java IO Overview
I/O is the core issue of human-computer interaction, Because I/O is the main channel for computers to acquire and exchange data.
The entire IO process is the source data ---> program ---> destination
IO Classification
Character-based I/O interfaces: Reader, Writer I/O
Type Pipewriter
Copy Code code as follows:
Type Pipewriter struct {
Contains filtered or unexported fields
}
(1) Func (w *pipewriter) Close () error closes the pipe, the read operation in progress will return EOF if there is still unread data in the pipe, and the subsequent reading is still normal
Copy Code code as follows:
Import (
"FMT"
"IO"
)
Func Main () {R, W: =
Blocking: When a user process accesses data, if IO is not completed, wait for IO to complete or make a system call to determine whether IO is completeNon-blocking: When a user process accesses data, it returns a status value immediately, whether or not it completes
Sync: Polling kernel state after user process initiates IO
Java IO producer stream and byte streamI. Basic Concepts
Stream: flows from one end to the other, from the source to the destination.Always centered on the program, it is a program and a file | array | Network Connection | database operations.
Ii. IO stream classification
1. Flow Direction:
Input stream and output stream
2. Data:
Byte stream: Binary. It can process text files, videos, and audios.Upload stre
Disks are usually the slowest subsystem of the computer and are the most prone to performance bottlenecks because the disk is farthest from the CPU and the CPU accesses the disk to involve mechanical operations such as rotating shafts, track-seeking, etc. The speed difference between accessing the hard disk and accessing the memory is calculated in order of magnitude, just like the difference between 1 days and 1 minutes. To monitor IO performance, it
In JDK 1.4, the NIO package is added, which is aimed at improving the IO speed. However, we all know that with the NIO package added, the old Io package is actually overwritten. Even if the NIO package is not displayed, You can obviously feel the speed improvement.
In addition, many people only know the inputstream or outputstream of the buffer when using the IO
In the high-performance I/O design, there are two well-known modes reactor and Proactor modes, where reactor mode is used for synchronous I/O, and Proactor is used for asynchronous I/O operations.
Before comparing these two patterns, we first understand a few concepts, what is blocking and non-blocking, what is synchronous and asynchronous, synchronous and asynchronous are for application and kernel interaction , Synchronization refers to the user process triggering
According to UNIX network programming, IO models can be divided into: blocking io, non-blocking io, io multiplexing, signal-driven IO, and asynchronous Io, divided into two classes according to POSIX standards: synchronous
Preface
Before seeing a very humorous way to explain the windows of the socket IO model, to borrow this story to explain the Linux socket IO model;
Lao Chen has a daughter who works in the field and can't often come back, Lao Chen and her through letter contact.Their letters will be delivered by the postman to the mailroom in front of their neighborhood. This is very similar to the socket model.
The foll
require the CPU (IO), it is suitable for the association process;Benefits of the co-process:
No overhead for thread context switching
No need for atomic operation locking and synchronization overhead
"Atomic operations (atomic operation) do not require synchronized", so-called atomic operations are operations that are not interrupted by the thread scheduling mechanism; Once this operation starts, it runs until the end, and the
UNIX file io is for file descriptors, while standard IO operations revolve around streams. When a stream is initially created, it is not directed. If a multibyte IO function is used on an non-directed stream, the orientation of the stream is set to wide orientation, and if a single byte IO function is used on the non-d
In High-performance I/O design, there are two well-known patterns reactor and Proactor modes, where the reactor mode is used to synchronize I/O, while Proactor is applied to asynchronous I/O operations.
Before you compare these two patterns, we first understand a few concepts, what is blocking and non-blocking, what is synchronous and asynchronous, synchronous and asynchronous are for application and kernel interaction, synchronization refers to the user process triggering
Label:The IO performance of SQL Server is affected by the IO latency of the physical disk and the IO operations performed internally by SQL Server. When monitoring disk performance, the primary measure (metric) is IO latency, which is the time delay in creating an IO request
The content of this section:
Introduction to I/O Models
Blocking I/O (blocking IO)
non-blocking I/O (non-blocking IO)
multiplexed I/O (IO Multiplexing)
Asynchronous I/O (asynchronous I/o)
IO Model comparison and analysis
Selectors module
Introduction to an
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.