http://www.artima.com/articles/io_design_patterns3.html
System I/O can be blocking, or non-blocking synchronous, or non-blocking asynchronous [
1,
2].
Blocking I/O means that the calling system does not return control to the caller until the operation is finished.
Most important, the caller thread cannot be reused for other request processing while waiting for the I/O to complete, and becomes a wasted resource during that time.
a non-blocking synchronous call returns control to the caller immediately.
it is the responsibility of the caller may repeat the call until it succeeds.
In a non-blocking asynchronous call, the calling function returns control to the caller immediately, reporting that the requested action was started.
Of the three approaches, this non-blocking asynchronous approach offers the best scalability and performance.
The Reactor patterns involve synchronous I/O, whereas the Proactor pattern involves asynchronous I/O.
Standard/classic Reactor:
- Step 1) wait for event (Reactor job)
- Step 2) dispatch "Ready-to-Read" event to user handler ( Reactor job)
- Step 3) read data (user handler job)
- Step 4) process data ( user handler job)
Proposed emulated Proactor:
- Step 1) wait for event (Proactor job)
- Step 2) read data (now Proactor job)
- Step 3) dispatch "Read-Completed" event to user handler (Proactor job)
- Step 4) process data (user handler job)
It internally implements three engines (POSIX AIO, SUN AIO and Emulated AIO) and hides
six different waiting strategies, based on
an asynchronous kernel API (for POSIX- this is not efficient right now due to internal POSIX AIO API problems)
and synchronous Unix
select()
,
poll()
,
/dev/poll (Solaris 5.8+),
port_get
(Solaris 5.10),
RealTime (RT) signals (Linux 2.4+),
epoll (Linux 2.6),
k-queue (FreeBSD) APIs.
the user can opt for an emulated async solutions built on different sync waiting strategies
分享到:
相关推荐
3.5 High-Density/High-Performance Packaging Summary / 3.21 3.6 Roadmap Information / 3.21 References / 3.21 Chapter 4. Advanced Component Packaging 4.1 4.1 Introduction / 4.1 4.2 Lead-Free / 4.2 4.3 ...
Chapter 2, Node.js Essential Patterns, introduces the first steps towards asynchronous coding and design patterns with Node.js discussing and comparing callbacks and the event emitter (observer ...
Comparing-KerasCV-YOLOv8-Models-on-the-Global-Wheat-Data
algorithms, by comparing both their theoretical properties and empirical performance. We show that an EKF formulation where the state vector comprises a sliding window of poses (the MSCKF algorithm) ...
本项目“Hadoop-comparing-two-text-files”聚焦于使用Hadoop MapReduce来比较两个文本文件,这对于数据比对、日志分析、数据一致性验证等场景非常有用。Hadoop基于Java编程语言实现,因此在编写MapReduce程序时,...
Real-Time Design Patterns <br>Many of us have had the experience of working with a truly great software designer. They have the ability to look at a really hard problem and seemingly with no ...
CAN FD 传统CAN之比较 CAN-FD比CAN总线的带宽更高,具有与CAN总线相似的控制器接口,这种相似性使ECU供应商不需要对ECU的软件部分做大规模修改,降低了开发难度和成本。CAN-FD是CAN总线的升级换代设计,它继承了CAN...
在IT行业中,I/O(Input/Output)程序设计是至关重要的,特别是在Java编程语言中。本文将深入探讨如何设计一个I/O程序,特别是在Java中实现文件的复制功能。我们将遵循标题和描述中的要求,详细解释如何打开文件...
高朗资源为什么去?...go-python-rangers-comparing-python-and-golang/?utm_campaign=Pat&utm_medium=Social&utm_source=Quorahttps://qarea.com/blog/why-do-enterprises-g
### 设计模式在Java与AspectJ中的对比分析 #### 背景介绍 设计模式作为软件工程领域的重要组成部分,旨在解决软件开发过程中遇到的常见问题。随着面向对象编程的普及,设计模式得到了广泛的应用和发展。...
- As the bandwidth requirements increased and I/O patterns became more random, the HDD platform suffered significant performance degradation. - The Violin Memory array maintained consistent ...
altera公司最全的元器件原理图与封装库包括max10等最新元器件
在讨论低功耗无线技术时,本文将对比包括Bluetooth低功耗(BLE)、ANT、ANT+、ZigBee、ZigBee RF4CE、Wi-Fi、Nike+、IrDA和近场通信(NFC)标准在内的多种无线技术。首先,我们将详细解析每种技术的特性、优点以及在...
Scott Mueller delivers practical answers about PC processors, mother-boards, buses, BIOSes, memory, SSD and HDD storage, video, audio, I/O, input devices, networks, Internet connectivity, power, and ...
Meshing-Point-Clouds-with-IER Codes for Meshing Point Clouds with Predicted Intrinsic-... Our key innovation is a surrogate of local connectivity, calculated by comparing the intrinsic/extrinsic metrics
Java-Image-Comparing-with-OpenCV项目是使用Java编程语言结合OpenCV库实现的一个图像比较程序。OpenCV(开源计算机视觉库)是一个强大的跨平台库,提供了大量的计算机视觉、图像处理和机器学习功能。 本项目的核心...
Normative achievement assessment of gifted children: Comparing the K-ABC, WRAT, and CAT Psychology in the Schoo/s Volume 23. October 1986 NORMATIVE ACHIEVEMENT ASSESSMENT OF GIFTED CHILDREN: ...