Using the Shared memory object for writing.
使用共享内存对象写数据。
Create your Shared memory object as shown in Listing 2.
像清单2这样创建共享内存对象。
If the Shared memory object cannot be found, an exception is thrown.
如果无法找到这个共享内存对象,就会抛出异常。
Because this process modifies the contents of the Shared memory object, you use read_write.
因为这个进程要修改共享内存对象的内容,所以使用read _ write。
In Listing 4, you create the Shared memory object using the open_only and read_only attributes.
在清单4中,使用open_only和read_only属性创建共享内存对象。
For a process to use a Shared memory object, the process has to map the object in its address space.
使用共享内存对象的进程必须在自己的地址空间中映射对象。
Another benefit of using mapped_region is that both full and partial access to the Shared memory object is possible.
使用mapped_region的另一个好处是可以对共享内存对象进行完全和部分访问。
For example, if the Shared memory object cannot be created, an exception of type boost: : interprocess_exception is thrown.
例如,如果无法创建共享内存对象,就抛出类型为boost: interprocess_exception的异常。
Similar to the case for a Shared memory object, a message queue that is opened only for reading will have the open_only attribute passed in the constructor.
与共享内存对象相似,对于以只读方式打开消息队列,应该把open_only属性传递给构造函数。
Object a starts right at the beginning of Shared memory.
对象A直接从共享内存的起始处开始。
The object construction is skipped if the Shared memory already exists.
如果共享内存已经存在,对象的构造就会被跳过。
Shared memory is created if it does not exist, and the shared object is created within it.
如果共享内存尚不存在,就创建共享内存;并在其中创建对象。
You can gem makes use of the Shared memory subsystem for object management.
GEM为对象管理使用了共享内存子系统。
To instantiate the object within the shared memory, define an additional class, Initializer.
要对共享内存中的对象进行实例化,请定义另外一个类Initializer。
To instantiate the object within the shared memory, define an additional class, Initializer.
要对共享内存中的对象进行实例化,请定义另外一个类Initializer。
应用推荐