`
iunknown
  • 浏览: 404136 次
社区版块
存档分类
最新评论

[zz]Emulate event driven i/o by IOCP

阅读更多
原文

It may be possible to use IOCompletionPorts on Windows to implement apr_pollset_*.  IOCPs
aare very scalable
but moving to IOCPs will require a complete rewrite of the apr_socket implementation on Windows.
And there is
the small matter of a simple technical issue that needs to be investigated...

IOCPs support true async network i/o. BSD KQ, Solaris /dev/poll, epoll et. al. are not async,
they are event
driven i/o models. When you issue an async read on Windows, the kernel will start filling
your i/o buffer as
soon as data is available. With event driven i/o, the kernel tells you when you can do a read()
and expect to
receive data. See the difference? Your buffer management strategy will be completely different
between async
i/o and event driven i/o and I am not sure how APR (or applications that use APR) can be made
to support both
cleanly. So back to the small technial issue that needs to be investigated...

I believe (but have not verified) that it is possible to use IOCPs to emulate event-driven
network i/o. When
you make read or write calls for which you want to emulate event driven i/o, pass in a 0 length
buffer (ie,
you can manage your i/o buffers using event driven semantics).  So if you issue a read passing
in a 0 length
buffer, your IOCP will get notified when there is data to read. I think :-)

Assuming the above technique works reliably, we still need to figure out how to optimize the
i/o. In general,
if there is data to read or write, synchronous calls are more efficient (if there is data
to read, then just
read it rather than telling the kernel to tell you via a notification method that there is
data to read. How
do you do that on Windows if you want to emulate event driven i/o?
分享到:
评论

相关推荐

    Android存储路径

    这是一个测试不同版本android存储路径的例子

    Bochs2.3 pre 3

    It includes emulation of the Intel x86 CPU, common I/O devices, and a custom BIOS. Currently, Bochs can be compiled to emulate a 386, 486, Pentium, Pentium Pro or x86-64 CPU, including ...

    打狗棒-加密狗复制

    CANE -----Emulate the softdog CANE /Axxx -----Analyse the softdog,xxx=extend mem kept CANE /R -----Read the softdog file CANE /W -----Write the softdog file CANE /U -----Free memory and to dos ...

    Emulate5000仿真模拟教材

    教你一步步的如何使用Emulate5000

    emulate5000使用录像

    emulate5000使用录像,资源共享,共同学习进步!

    java版商城源码下载-HotCodeTest:hotcode热更新学习

    emulate//chrome浏览器运行,前提安装了ripple-emulate cordova run android//platforms安装了android cordova run ios//platforms安装了ios 背景 现在很多应用和游戏都使用热更新功能,常见的热更新

    RSLogix_Emulate500使用教程

    RSLogix_Emulate500使用教程

    cordova-electron

    bin/create bin/update bin/check_reqs bin/templates/scripts/cordova/build bin/templates/scripts/cordova/clean bin/templates/scripts/cordova/log bin/templates/scripts/cordova/emulate bin/templates/...

    Emulate5000仿真模拟教材.ppt

    Emulate5000仿真模拟教材ppt,Emulate5000仿真模拟教材

    Python库 | iotile_emulate-0.5.0-py3-none-any.whl

    资源分类:Python库 所属语言:Python 资源全名:iotile_emulate-0.5.0-py3-none-any.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    AB_Emulate_5000_使用方法.pdf

    RSlogix Emulate 5000软件是Rockwell AB公司提供用来仿真运行PLC的程序,通过它可以在计算机上虚拟AB PLC的连接、烧写、运行操作,就像实际操作PLC一样。本文介绍RSlogix Emulate 5000软件的安装和使用方法。

    Emulate5000应用之二(logix5000仿真软件)

    Emulate5000应用之二(logix5000仿真软件) Emulate5000应用之二(logix5000仿真软件)

    rslogix emulate 500

    relogix emulate 500 仿真用的,需要的拿去吧

    qemu-0.13.0(编译过全处理器支持)

    i.e. -set drive.$id.file=/path/to/image -global driver.property=value set a global default for a driver property -mtdblock file use 'file' as on-board Flash memory image -sd file use 'file' as ...

    BUS Hound

    98, Me, NT 4.0, 2000, 2003, XP and XP Embedded  Capture megabytes of I/O limited only by available memory  Automatically stop the capture upon a trigger condition  Measure individual ...

    RSLogix_Emulate_5000_软件的使用

    PLC初学者必备,梯形图编程,5000多个实例,让你迅速入门!

    Safari and WebKit Development for iPhone OS 3.0

    * Instructs on how your Web app can respond to finger touch events that are a core part of the iPhone event model. * Shows you how to create Web-based offline applications using the latest ...

    Emulate5000仿真模拟教材_ab_

    AB PLC仿真模拟教程,参照教程可以进行,在没有现场设备的情况下,可以下仿真运行

Global site tag (gtag.js) - Google Analytics