Chinaunix首页 | 论坛 | 博客
  • 博客访问: 562953
  • 博文数量: 104
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1559
  • 用 户 组: 普通用户
  • 注册时间: 2014-08-21 00:58
个人简介

锻炼精神,首先要锻炼肉体

文章分类

全部博文(104)

文章存档

2018年(1)

2016年(1)

2015年(101)

2014年(1)

我的朋友

分类: C/C++

2015-06-09 10:00:58

Rationale - 1.58.0
(Boost 1.58.0 版本中创建函数库 Boost.Asio 的)合理性分析/Boost.Asio 之所以创建出来,主要用于解决何种问题

Most programs interact with the outside world in some way, whether it be via a file , a network,a serial cable , or the console.
几乎所有的程序都是用于与外界相交互的,它们与外界通信的所借助的媒介,可以是文件,网络,串行总线或控制台.

Sometimes,as is the case with networking, individual I/O operations can take a long time to complete.
有时,当程序与外界交互的媒介是网络的话,独立的读写操作将会花费很多时间.

This poses particular challenges to application development.
所以, 对于应用程序开发来说,如何处理I/O 读写操做成为了一项特殊的挑战.

Boost.Asio provides the tools to manage these long running operations,without requiring programs to use concurrency models bases on threads and explicity locking.
Boost.Asio函数库中提供了用于管理长时间运行的方法工具库函数, 有了它便可无需基于线程和显示上锁方法的并发模型上进行开发。

The Boost.Asio library is intended for programmers using C++ for systems programming,where access to operating system functionality such as networking is often required.
Boost.Asio 开发的宗旨是为了让程序员使用 C++ 语言来进行系统编程,在系统编程中经常会涉及到访问操作系统中的方法,比如说网络这一块就经常需要访问操作系统.

In particular, Boost.Asio addresses the following goals :
Boost.Asio 之所以被开发主来,主要针对解决下列几个问题:
(在这里正式电梯,Rationale : Boost.Asio 存在的合理性)
  • Portability. The library should support a range of commonly used operating systems , and provide consistent behaviour across these operating systems.
  • 可移植性. 库函数应该支持一系列主流的操作系统,并且基于不同的操作平台上提供一致的操作方法.


  • Scalability. The library should facilitate the development of network applications that scale to thousands of concurrent connections. The library implementations for each operating system should use the mechanism that best enable this scalability.
  • 可扩展性. 库函数应该为涉及到数以千计的网络连接的网络程序的开发提供便利条件. 在每种型号的操作信共同中,(Boost.Asio) 函数库的实现都应该遵照这样的初衷: 将在该操作系上所编写的程序的可扩展性实现到最大化.


  • Efficiency. The library should support techniques such scatter-gather I/O, and allow programs to minimis data copying.
  • 有效性. (被设计实现的)Boost.Asio 函数库应该支持: 读写操作的分散-集中式处理和允许程序将数据拷贝最小化这样的技术


  • Model concepts from established APIs , such as BSD sockets. The BSD socket API is widely implemented and understood , and is covered in much literature. Other programming languages often use a similar interface for networking APIs. As far as reasonable,Boost.Asio should leverage existing practice.
  • (Boost.Asio 函数库中)模型的这一想法均来源于已经制定好了的应用程序接口,像 BSD 系列操作系统中的套接字处理接口函数(API ). BSD 操作系统中的套接字应用程序接口已被广泛的实现并为人所知,且被记录于许多文献内. 其他的编程语言中常编写相似的接口作为网络操作的应用程序编程接口.  只要合理的被使用, Boost.Asio 函数库可以利用已有的实例.(这里我没太看懂.... 是我编的,我编不下去了.....)


  • Ease of use. The library should provide a lower entry barrier for new users by taking a toolkit, rather than framework, approach. That is , it should try to minimise the up-front investment in time to just learning a few basic rules and guidelines. After that , a library user should only need to understand the specific functions that are being used.
  • 易用性. (Boost.Asio )函数库应该向新手们提供一个有着较低的门槛工具集,而不是框架或是资料库.正因如此,(Boost.Asio 函数库的设计应该)试图将使用者在前期时间投资最小化,即,让使用者在学习基本规则和参考教程上所花费最少的时间。在此之后,函数库的使用者仅仅需要学习要使用的某些特定方法便可以.
Although Boost.Asio started life focused primarily on networking, its concepts of asynchronous I/O have been extended to include other operating system resources such serial ports,file descriptors, and so on.
虽然 Boost.Asio 函数库被创造的初衷主要是用于网络,但是它在异步读写处理上面的思想已经被操作系统中其他资源调度所引用,如串行端口,文件描述符(这些系统资源在进行 I/O 异步操作的时候都会借鉴 Boost.Asio 网络函数中在读写操作方面的处理机制)


阅读(940) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~