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)

Building Boost.Interprocess

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的链接错误,请查看你的系统文档来确定哪些库实现了它们。

Tested compilers

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

你可能感兴趣的:(documentation,include,library,variables,compilation,containers)