Boost.Interprocess翻译-简介

Introduction

Boost.Interprocess simplifies the use of common interprocess communication and synchronization mechanisms and offers a wide range of them:

Boost.Interprocess 简化了一般情况下的进程间通讯及其同步机制(有高级的需求我也无法满足),并提供了多种进程间通讯方式:

  • Shared memory.
  • Memory-mapped files.
  • Semaphores, mutexes, condition variables and upgradable mutex types to place them in shared memory and memory mapped files.
  • Named versions of those synchronization objects, similar to UNIX/Windows sem_open/CreateSemaphore API.
  • File locking.
  • Relative pointers.
  • Message queues.
  • 共享内存(Shared memory).
  • 内存映射文件(Memory-mapped files).
  • 信号,互斥,条件变量,以及可以放置到共享内存和内存映射文件中的高级互斥类型
  • 可命名的同步对象,类似UNIX/Windows sem_open/CreateSemaphore API.
  • 文件锁
  • 相对指针
  • 消息队列

Boost.Interprocess also offers higher-level interprocess mechanisms to allocate dynamically portions of a shared memory or a memory mapped file (in general, to allocate portions of a fixed size memory segment). Using these mechanisms, Boost.Interprocess offers useful tools to construct C++ objects, including STL-like containers, in shared memory and memory mapped files:

Boost.Interprocess 也提供了高级进程间通讯机制,可从共享内存或内存映射文件中分配动态的内容 (一般来说,是分配固定大小内存段的内容)。 利用这种机制,Boost.Interprocess提供了一些有用的工具, 能够在共享内存和内存映射文件上构造C++对象,以及类似STL容器:

  • Dynamic creation of anonymous and named objects in a shared memory or memory mapped file.
  • STL-like containers compatible with shared memory/memory-mapped files.
  • STL-like allocators ready for shared memory/memory-mapped files implementing several memory allocation patterns (like pooling).
  • 动态地创建在共享内存或内存映射文件上创建匿名和命名对象
  • 类STL容器和兼容共享内存/内存映射文件 STL-like containers compatible with shared memory/memory-mapped files.
  • 类STL分配器(allocators)可以在共享内存/内存映射文件实现几个内存分配模式(如pooling)

There is no need to compile Boost.Interprocess, since it's a header only library. Just include your Boost header directory in your compiler include path.

不必编译Boost.Interprocess, 由于它是头文件库. 只需要在编译器的“include”参数中包含Boost头文件路径

Boost.Interprocess depends on Boost.DateTime, which needs separate compilation. However, the subset used by Boost.Interprocess does not need any separate compilation so the user can define BOOST_DATE_TIME_NO_LIB to avoid Boost from trying to automatically link the Boost.DateTime.

Boost.Interprocess 依赖 Boost.DateTime, 它需要分开编译。可是,使用Boost.Interprocess 的子集不需要分开编译,所以用户能够定义 BOOST_DATE_TIME_NO_LIB 避免Boost自动链接 Boost.DateTime库.

 

In POSIX systems, Boost.Interprocess uses pthread system calls to implement classes like mutexes, condition variables, etc... In some operating systems, these POSIX calls are implemented in separate libraries that are not automatically linked by the compiler. For example, in some Linux systems POSIX pthread functions are implemented in librt ial">.a library, so you might need to add that library when linking an executable or shared library that uses Boost.Interprocess. If you obtain linking errors related to those pthread functions, please revise your system's documentation to know which library implements them.

在 POSIX 系统上, Boost.Interprocess 使用pthread相关的系统调用实现了一些类,如 mutexes, condition variables等。 在一些系统上 ,这些POSIX调用在一个单独的库中实现,它们不是由编译器自动链接的, 比如,在一些Linux系统上pthread功能在 librt.a 库中实现,所以你使用Boost.Interprocess编译可执行程序或者共享库时,需要添加这些库。 如果你遇到有关pthread的链接错误,请查看你的系统文档来确定哪些库实现了它们。

Boost.Interprocess has been tested in the following compilers/platforms:

Boost.Interprocess 已经在下面的编译器/平台下测试:

  • Visual 7.1 Windows XP
  • Visual 8.0 Windows XP
  • GCC 4.1.1 MinGW
  • GCC 3.4.4 Cygwin
  • Intel 9.1 Windows XP
  • GCC 4.1.2 Linux
  • GCC 3.4.3 Solaris 11
  • GCC 4.0 MacOs 10.4.1
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值