Proactor    An Object Behavioral Pattern for Demultiplexingand Dispatching Handlers for Asynchronous Events



Douglas C. Schmidt



Known Uses



The following are some widely documented uses of the Proctor pattern:



I/O Completion Ports in Windows NT:

The Windows NT operating system implements the Proactor pattern.

Various Asynchronous Operations such as accepting new network connections, reading and writing to files and

sockets, and transmission of files across a network connection are supported by Windows NT.

The operating system is the Asynchronous Operation Processor.
Results of the operations are queued up at the I/O completion port
(which plays the role of the Completion Dispatcher).



The UNIX AIO Family of Asynchronous I/O Operations:



On some real-time POSIX platforms, the Proactor pattern is implemented by the aio family of APIs 
These OS features are very similar to the ones described above for Windows NT.
One difference is that UNIX signals can be used to implement an truly asynchronous Completion Dispatcher
(the Windows NT API is not truly asynchronous).


ACE Proactor: 

The Adaptive Communications Environment (ACE)  implements a Proactor component that encapsulates I/O Completion Ports on Windows NT
and the  aio APIs on POSIX platforms. 

The ACE Proactor abstraction provides an OO interface to the standard C APIs supported by Windows NT.

Asynchronous Procedure Calls in Windows NT:




Some

systems (such as Windows NT) support Asynchronous Procedure Calls (APC)s.




An APC is a function that executes asynchronously in the context of a particular thread.
When an APC is queued to a thread, the system issues a software interrupt. 
The next time the thread is scheduled, it will run the APC.
 APCs made by operating system are called
kernelmode APCs. APCs made by an application are called
usermode APCs.




在windowsserver中要创建高性能,灵活server必定涉及到IOCP的使用。而IOCP又是Proactor Pattern的实践。
同一时候随着java跨平台语言的发展。java语言在JDK7(2009年)提供了对于Asyn IO的支持,为java语言作为跨平台网络server提供了更好的支持。
java NIO中的Aysn I/O 同一时候也是一种对于Proactor Pattern的实践。

Proactor 学习1的更多相关文章

  1. 转载:reactor模式学习

    最近又重新看了下netty背后的设计思想,接触到了reactor模型.发现以前虽然也看过reactor和proactor模型的介绍,但是真的是只了解了个皮毛. 再重新学习了一遍,有了更深刻的认识.但是 ...

  2. 每周一荐:学习ACE一定要看的书

    作 者:david++发布时间:2012/06/08 09:02文章地址:http://game-lab.org/?p=320 近两个月都在学习ACE,一个超级强大,也超级复杂的网络框架库.对ACE的 ...

  3. IO设计模式:Reactor和Proactor对比

    IO设计模式:Reactor和Proactor对比 平时接触的开源产品如Redis.ACE,事件模型都使用的Reactor模式:而同样做事件处理的Proactor,由于操作系统的原因,相关的开源产品也 ...

  4. 两种高性能 I/O 设计模式 Reactor 和 Proactor

    两种高性能 I/O 设计模式 Reactor 和 Proactor Reactor 和 Proactor 是基于事件驱动,在网络编程中经常用到两种设计模式. 曾经在一个项目中用到了网络库 libeve ...

  5. 设计模式-前摄器模式(Proactor)

    本周要进行boost asio库的学习,在学习之前发现最好需要先了解一下前摄器模式,这样对asio库的理解很有帮助,故写下此文 我之前写的随笔XShell的模拟实现中的链接方式可以说是同步的(服务器阻 ...

  6. I/O模型之三:两种高性能 I/O 设计模式 Reactor 和 Proactor

    目录: <I/O模型之一:Unix的五种I/O模型> <I/O模型之二:Linux IO模式及 select.poll.epoll详解> <I/O模型之三:两种高性能 I ...

  7. Mudo C++网络库第三章学习笔记

    多线程服务器的适用场合与常用编程模型 进程间通信与线程同步; 以最简单规范的方式开发功能正确.线程安全的多线程程序; 多线程服务器是指运行在linux操作系统上的独占式网络应用程序; 不考虑分布式存储 ...

  8. muduo学习笔记(二)Reactor关键结构

    目录 muduo学习笔记(二)Reactor关键结构 Reactor简述 什么是Reactor Reactor模型的优缺点 poll简述 poll使用样例 muduo Reactor关键结构 Chan ...

  9. Libevent学习之SocketPair实现

    Libevent设计的精化之一在于把Timer事件.Signal事件和IO事件统一集成在一个Reactor中,以统一的方式去处理这三种不同的事件,更确切的说是把Timer事件和Signal事件融合到了 ...

随机推荐

  1. [J2EE] 有关 PreparedStatement

    今天同事遇到一个问题,简言之,就是PreparedStatement的预编译究竟是怎么发挥作用的... 嘿嘿,说来惭愧,我以前就只知道PreparedStatement比Statement要好,要防S ...

  2. sql分区文件删不的可能解决方法

    删除数据库分区的时候报错如下: ALTER DATABASE [ITMP2] remove FILE F20170427Msg 5042, Level 16, State 1, Line 1The f ...

  3. JS中!=、==、!==、===的用法和区别

    1.对于string,number等基础类型,==和===是有区别的 1)不同类型间比较,==之比较"转化成同一类型后的值"看"值"是否相等,===如果类型不同 ...

  4. 设计模式的征途—15.观察者(Observer)模式

    在日常生活中,交通信号灯指挥者日益拥挤的城市交通.红灯亮,汽车停止:绿灯亮,汽车继续前行:在这个过程中,交通信号灯是汽车的观察目标,而汽车则是观察者.随着交通信号灯的变化,汽车的行为也会随之变化,一盏 ...

  5. Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3 Tools Update

    ASP.NET MVC 3 can be installed side by side with ASP.NET MVC 2 on the same computer, which gives you ...

  6. Unity3D游戏xlua轻量级热修复框架

    这是什么东西 前阵子刚刚集成xlua到项目,目的只有一个:对线上游戏C#逻辑有Bug的地方执行修复,通过考察了xlua和tolua,最终选择了xlua,原因如下: 1)项目已经到了后期,线上版本迭代了 ...

  7. Python 函数相关概念

    高阶函数  数学概念 y=g(f(x))  在数学和计算机科学中,高阶函数应当至少满足下面一个条件的函数   条件1. 接受一个或多个函数作为参数  条件2. 输出一个函数 举例: def count ...

  8. F - Capture

    F - Capture 题链 题意 给你两种颜色的物品,有n组,每组有第一种颜色有w个,第二种为d个,每组必须选一种,求最后第一种颜色占的比值不低于K的最少需要选第一种的组数. 思路 首先没组都选第一 ...

  9. TP框架中内置查询IP函数

    系统内置了get_client_ip方法用于获取客户端的IP地址,使用示例: $ip = get_client_ip(); 如果要支持IP定位功能,需要使用扩展类库Org\Net\IpLocation ...

  10. Android studio导出配置

    在使用 Android Studio 时,往往会进行一些设置,比如 界面风格.字体.字体大小.快捷键.常用模板等.但是这里的设置只能用在一个版本的 Android Studio 上,如果下载了新的 A ...