zoukankan      html  css  js  c++  java
  • Proactor 学习1

    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的实践。















  • 相关阅读:
    js/Jquery table 内部控件计算和tr的生成
    反射 实体类的赋值/取值问题
    C#读取Excel 几种方法的体会
    水晶报表升级遇到的问题
    使用异或位运算符实现交换两个整数详解
    美国宇航局两万兆数据存储方案下载
    Flash全屏(转载)
    Unity3D实现动态加载游戏资源
    C#,ASP.NET jquery uploadify上传控件中文乱码解决办法
    HTML通过button触发inputfile控件上传文件的问题
  • 原文地址:https://www.cnblogs.com/zsychanpin/p/6897140.html
Copyright © 2011-2022 走看看