Boost.Interprocess使用手册翻译之一:介绍 (Introduction)
来源:互联网 发布:网络电视wifi连接不了 编辑:程序博客网 时间:2024/04/29 17:59
写在最前:
1. 原文来源:http://www.boost.org/doc/libs/1_49_0_beta1/doc/html/interprocess.html#interprocess.intro
2. 基于boost_1_49_0_beta1
3. 译者水平有限,不当之处请各位海涵。同时盼多多交流。
一.介绍
创建 Boost.Interprocess
测试编译器
Boost.Interprocess简化了普通进程间通信以及同步机制的使用,并且提供了以下广泛内容:
- 共享内存
- 内存映射文件
- 在共享内存和内存映射文件中使用信号量,互斥,条件变量以及可升级互斥类型
- 这些同步对象的命名版本,类似于UNIX/Windows的sem_open/CreateSemaphore API
- 文件锁
- 相对指针
- 消息队列
Boost.Interprocess同时也提供了更高层次的进程间通信机制,用于分配共享内存或内存映射文件的动态部分(一般是分配一个固定大小的内存段)。使用此机制,Boost.Interprocess在共享内存以及内存映射文件中提供了有用的工具用于构建C++对象,包括类STL容器:
- 在共享内存或内存映射文件中动态创建匿名和命名对象
- 与共享内存或内存映射文件兼容的类STL容器
- 准备为共享内存/内存映射文件执行一些内存分配模式的类STL分配器(类似内存池)
创建 Boost.Interprocess
Boost.Interprocess不需要编译,因为它是一个仅有头文件的库(译注:实际上Boost中的大多数库都是采用源代码引用的方式使用,不需要编译)。仅需要在你的编译器中包含Boost头文件夹路径即可。
Boost.Interprocess依赖于Boost.DateTime,它需要单独编译。然而,被Boost.Interprocess使用的子集是不需要单独编译的,因此用户可以定义BOOST_DATE_TIME_NO_LIB来避免Boost尝试自动链接Boost.DateTime。
在POSIX 系统中,Boost.Interprocess使用pthread系统调用来执行类,比如互斥、条件变量等。在一些操作系统中,这些POSIX调用是在单独的库中被执行的,编译器不会自动链接。例如,在一些Linux操作系统中POSIX pthread函数是在librt.a库中执行,因此当链接一个使用Boost.Interprocess的可执行或共享的库时,你可能需要添加那个库。如果出现与这些pthread函数相关的链接错误时,请参考你的系统文档以便了解哪些库执行它们。
测试编译器
Boost.Interprocess已经在以下的编译器/平台上进行过测试:
- Visual >= 7.1
- GCC >= 4.1
- Intel 11
- Boost.Interprocess使用手册翻译之一:介绍 (Introduction)
- Boost.Interprocess使用手册翻译之一:介绍 (Introduction)
- Boost.Interprocess使用手册翻译之一:介绍 (Introduction)
- Boost.Interprocess使用手册翻译之一:介绍
- Boost.Interprocess使用手册翻译之二:快速指南 (Quick Guide for the Impatient)
- Boost.Interprocess使用手册翻译之三:一些基本解释 (Some basic explanations)
- Boost.Interprocess使用手册翻译之四:在进程间共享内存 (Sharing memory between processes)
- Boost.Interprocess使用手册翻译之六:同步机制(Synchronization mechanisms)
- Boost.Interprocess使用手册翻译之七:托管内存片段(Managed Memory Segments)
- Boost.Interprocess使用手册翻译之九:内存分配算法(Memory allocation algorithms)
- Boost.Interprocess使用手册翻译之十:直接输入输出流(iostream)格式化:vectorstream 和bufferstream
- Boost.Interprocess使用手册翻译之十一:所有权的智能指针(Ownership smart pointers)
- Boost.Interprocess使用手册翻译之十二.架构和内部实现(Architecture and internals)
- Boost.Interprocess使用手册翻译之六:同步机制(Synchronization mechanisms) .
- Boost.Interprocess使用手册翻译之二:快速指南 (Quick Guide for the Impatient)
- Boost.Interprocess使用手册翻译之三:一些基本解释 (Some basic explanations)
- Boost.Interprocess使用手册翻译之四:在进程间共享内存 (Sharing memory between processes)
- Boost.Interprocess使用手册翻译之六:同步机制(Synchronization mechanisms)
- Card Game Mechanics in Sprite Kit with Swift
- (TopkOnJstorm)第九周工作报告:2014-09-01~2014-09-07
- POJ Dropping tests
- java.lang.IllegalArgumentException: Can not set XXX to com.sun.proxy.$Proxy28
- MVP模式与MVC模式
- Boost.Interprocess使用手册翻译之一:介绍 (Introduction)
- IOS 开发缓存机制----内存缓存机制
- LeetCode: Combinations 递归回溯 2种实现方法
- 学习笔记:如何开个有效的站会
- 为什么微波炉加热某些食物会爆炸?
- Storm实战之概念简介
- Boost.Interprocess使用手册翻译之二:快速指南 (Quick Guide for the Impatient)
- swift 语言更新进度
- flex 上传整理