client has a connection request when the server needs to start a thread to process, if the connection does not do anything will cause unnecessary thread overhead, of course, can be improved through the thread pool mechanism.Synchronous non-blocking IO (Java NIO): Synchronous non-blocking, the server implementation mode is a request for a thread, that is, the connection request sent by the client is registered to the multiplexer, and the
The answer is very good. Sockets and Socketchannel are two sets of APIs, for network TCP communication is not concerned about what API you use to achieve communication. So the answer is yes. Socketchannel can be set to non-blocking, so in some cases the performance is better and the thread will not be suspended. Socketchannel can also register selector and events of interest. Selector Multiplexer There is not much to introduce.The flow of data in the
video format conversion, the video capture picture, gives the video watermark and so on.Basic concepts of FFmpeg:Container (Container): Is the file format, in the FFmpeg, the container used to abstract the file format is avformatcontext;Stream: The data stream is the multimedia data stream we see, it contains several basic data streams, including: video stream, audio stream, subtitle stream, as I understand it, the abstraction of data flow in FFmpeg is Avstream.
EndDefaultBeginResult EndEndcaseEndEndmoduleFigure 1 Example 4 integrated circuit diagram (all of the combined logic)4. Multi-channel selection, an exampleData selector (also known as: Multiplexer, English: multiplexer, Shorthand: MUX), is a device that selects a signal from a multiple input signal as output. The electrical symbol 2 shows.Figure 2 Electrical symbols for the data selectorThe logical functio
be improved through the thread pool mechanism.
Java NIO: Synchronous non-blocking, the server implementation mode is a request for a thread, that is, the connection request sent by the client is registered on the multiplexer, and the multiplexer polls to the connection with an I/O request to start a thread for processing.
Java AIO (nio.2): Asynchronous non-blocking, server implementation mode for a
longer able to receive any input, even if it is running in the foreground.
REDIRECT standard output and standard error to file nohup.out .
In other words, the nohup command actually separates the child process from the session it is in.Note that the nohup command does not automatically turn the process into a "background task", so you must add a symbol.Seven, screen command and Tmux commandAnother idea is to use the terminal multiplexer
comes back. (Of course, the real world is not, but it is true in computers.) )4 Non-blocking non-blocking state, if there is nothing to read, or not to write, read and write function immediately return, and do not wait, the bank in the withdrawal business, collect a small ticket, we can play mobile phone after the collection, or chat with others, when the wheel we, the bank's horn will be notified, this time we can go.Java support for bio, NIO, AIO:Java BIO: Synchronization and blocking, the se
been accumulated in the send queue to complete;
The message that is being write or read needs to be processed;
Set the scheduled task in the Nioeventloop thread scheduler, which needs to be performed or cleaned up.
Let's look at the main operations and resource objects involved in Netty graceful exit:Netty 's graceful exit summed up three big steps:
The state bit of the NIO thread is set to the St_shutting_down state, and no new messages are processed (the message is not a
IO operations to complete, and then notifies the application when the kernel completes the IO operation.Synchronous blocking IO (JAVA BIO):Synchronization and blocking, the server implementation mode for a connection to a thread, that is, the client has a connection request when the server needs to start a thread to process, if the connection does not do anything will cause unnecessary thread overhead, of course, can be improved through the thread pool mechanism.Synchronous non-blocking IO (Jav
all Chinese technical books translate selector into selectors, but in fact I think this kind of translation is not appropriate, the selector is only literal meaning, can not reflect the function and characteristics of selector.The key to the implementation of Java NiO described above is the multiplexing I/O technology, where the core of multiplexing is to poll the channel registered on it through selector, and when one or more channel is found to be in a ready state, An I/O operation is perform
' queue is the ' full would be refused. The default value is 100.
A lot of data on the Internet shows that the maximum number of threads Linux is 1000,window will be higher than a little more than 2000. This should be based on the performance of the machine CPU and so on.
The actual configuration data should be based on their own machine and load situation to try to find an optimal configuration.
3, Tomcat bio,nio,apr Three kinds of advanced connector operation mode.
Tomcat supports the above
consist of wavelength multiplexer/multiplexer, wavelength-selective space switch and wavelength switch (wavelength switches).
At present, Wavelength division multiplexing (WDM) system is developed, which is about 10. Recently, a kind of 1.2tb/s wavelength division switching system has been developed, it adopts the wavelength division multiplexing number of 128, the maximum terminal number is 2048, and the
of IO processing.
Differentiate between asynchronous and synchronous
synchronization, a reliable and orderly operation mechanism, in the synchronous operation, the subsequent tasks to wait for the current call to return;
Asynchronously, other tasks do not need to wait for the current call to return, depending on the event, callback mechanism to implement the task invocation.
Blocking and non-blocking
Blocked, the current thread is in a blocked state and cannot perform other tasks, only if the
to receive any input, even if it is running in the foreground.
REDIRECT standard output and standard error to file nohup.out .
In other words, the nohup command actually separates the child process from the session it is in.Note that the nohup command does not automatically turn the process into a "background task", so you must add a symbol.Seven, screen command and Tmux commandAnother idea is to use the terminal multiplexer (Terminal
multiple status bits that can be identified by selectorBuffer (buffer):A buffer is an area of memory (an array) that is wrapped in NiO as a buffer object. Buffer provides methods to access the memory.In bio, data is stored in a stream, and in NiO, the data is stored in a buffer.In addition to the Boolean other Java seven basic types have the corresponding buffer class. Most commonly used is the BytebufferSelector (multiplexer): Responsible for pollin
any input, even if it is running in the foreground.
REDIRECT standard output and standard error to file nohup.out .
In other words, the nohup command actually separates the child process from the session it is in.Note that the nohup command does not automatically turn the process into a "background task", so you must add a symbol.Seven, screen command and Tmux commandAnother idea is to use the terminal multiplexer (Terminal
operating system are generally full-duplex, so full-duplex channel streams can better map the underlying operating system's APIs.There are two major types of channel:
Selectablechannel: User network read/write
FileChannel: For file operations
The Serversocketchannel and socketchannel that are involved in the following code are subclasses of Selectablechannel.2.4. Multiplexer SelectorSelector is the basis for Java NIO programming.Sel
is that when a connection is created, it does not need to correspond to a thread, this connection will be registered on the multiplexer, so all the connections need only one thread can be done, when the multiplexer in this thread polling, found the connection on the request to open a thread to handle, That is, a request for a threading pattern.In the process of NIO, when a request comes in, open the thread
Java NiO Core Class library Multiplexer selector is based on epoll multiplexing technology implementation
Compared to select, poll system calls, Epoll has the following advantages:
1. The socket descriptor (FD) that supports one process opens is unrestricted and limited to the maximum number of file handles for the operating system.The biggest flaw in select is that there is a limit to the amount of FD opened by a single process, set by Fd_setsize, 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.