Netty

 

OS API provides the basic function for application to interact with underlying resource managed by OS, such as disk file, memory GUI,network, event, OS object, thread.

You can use these API to construct your own framework  or application. 

In Reactor socket programming, the OS provide you Synchronization API to create socket, bind port, connect to remote, read and write socket and direct memory buffer.

Meanwhile the OS also offer the addition indirections that can notify you something you intreasted happened when hardware create interrupts and OS competed handling

interrupts. Take socket as example, we can create socket ans selector with OS API, and then use OS API to register some intrested events of the socket to selector.

Now some of Synchronization operation can be handled as Asynchronous operation. 

When the you call OS API to do something, you just call it in unblocked way, at the same time you registed the event to related handle. 

If the OS completes the task that you, the OS will check if the related handle exist, and created connection between event and handle. 

and you continually check if there is event related the handle in another thread. If event exist, we handle it, or just put it on queue to notify other thread to handle. 

 

1. Reactor Model

 

2. Event-Driven

3. Thread Model

 

转载于:https://www.cnblogs.com/iiiDragon/p/9662480.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值