Skip to content

The Implementation of Blocking IO, Non-blocking IO and Netty

Notifications You must be signed in to change notification settings

Zinaaan/io-implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

io-implementation

The Implementation of Blocking IO, Non-blocking IO and Netty

BIO-V1

image

The server only use one thread to receive and handle client sockets. If current socket is still in processing, the subsequent socket will be blocked.

BIO-V2

New-1:

The server will open a separate thread to process each new socket so that the multiple socket could process concurrently.

New-2:

The server will create a thread pool to reduce the overhead of thread creation and destruction.

NIO-V1

Add each socket events to array, and continuously loop to check and process it even if this socket didn't send any message

NIO-V2

Initialize a Selector to receive the socket events. The selector will start processing only when there are some socket registered.

About

The Implementation of Blocking IO, Non-blocking IO and Netty

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages