博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Reactor Pattern and Non-blocking IO--reference
阅读量:2233 次
发布时间:2019-05-09

本文共 1542 字,大约阅读时间需要 5 分钟。

reference from:http://www.cs.bgu.ac.il/~spl051/Personal_material/Practical_sessions/Ps_12/ps12.html

  • Java server class with multiple client connections: one-to-one ratio of threads to clients, therefore enormous thread overhead, resulted in performance problems and lack of scalability. The main problem is blocking I/O calls.
  • JDK 1.4 supports non-blocking I/O calls ( and ). These packages were designed principally according to Reactor design pattern ( by Douglas C. Schmidt).

 

 

 

The actors in Reactor pattern are:

• Handles, which identify resources (such as network connections, open files, and synchronization

objects) that are managed by an operating system.

• Reactor, which defines an interface for registering, removing, and dispatching Event Handler

objects. An implementation of the Reactor interface provides a set of application-independent

event demultiplexing and dispatching mechanisms. These mechanisms dispatch application-specific

Event Handler in response to events occurring on one or more Handles.

• Event Handler, which specifies an interface used by the Reactor to dispatch callback methods

defined by objects that are pre-registered to handle certain types of events (such as input events,

output events, and signals).

• Concrete Event Handler, which implements the customized callback method(s) that process events

in an application-specific manner.

 

Using Reactor in Communication Software

    • Important classes in :
      •   (Reactor)
      •  

 

Example

  •  (Event Handle)
  •  (Event Handle)

转载于:https://www.cnblogs.com/davidwang456/p/3705780.html

你可能感兴趣的文章
【深度学习】LSTM的架构及公式
查看>>
【python】re模块常用方法
查看>>
剑指offer 19.二叉树的镜像
查看>>
剑指offer 20.顺时针打印矩阵
查看>>
剑指offer 21.包含min函数的栈
查看>>
剑指offer 23.从上往下打印二叉树
查看>>
剑指offer 25.二叉树中和为某一值的路径
查看>>
剑指offer 60. 不用加减乘除做加法
查看>>
Leetcode C++《热题 Hot 100-15》437.路径总和III
查看>>
Leetcode C++《热题 Hot 100-17》461.汉明距离
查看>>
Leetcode C++《热题 Hot 100-18》538.把二叉搜索树转换为累加树
查看>>
Leetcode C++《热题 Hot 100-21》581.最短无序连续子数组
查看>>
Leetcode C++《热题 Hot 100-22》2.两数相加
查看>>
Leetcode C++《热题 Hot 100-23》3.无重复字符的最长子串
查看>>
Leetcode C++《热题 Hot 100-24》5.最长回文子串
查看>>
Leetcode C++《热题 Hot 100-28》19.删除链表的倒数第N个节点
查看>>
Leetcode C++《热题 Hot 100-29》22.括号生成
查看>>
Leetcode C++《热题 Hot 100-47》236.二叉树的最近公共祖先
查看>>
Leetcode C++《热题 Hot 100-48》406.根据身高重建队列
查看>>
《kubernetes权威指南·第四版》第二章:kubernetes安装配置指南
查看>>