|
|
< Previous PageNext Page > |
The Mac OS X VM system provides an abstraction known as a named entry. A named entry is nothing more than a handle to a shared object or a submap.
Shared memory support in Mac OS X is achieved by sharing objects
between the memory maps of various tasks. Shared memory objects
must be created from existing VM objects by calling vm_allocate
to
allocate memory in your address space and then calling mach_make_memory_entry_64
to
get a handle to the underlying VM object.
The handle returned by mach_make_memory_entry_64
can
be passed to vm_map
to
map that object into a given task’s address space. The handle
can also be passed via IPC or other means to other tasks so that
they can map it into their address spaces. This provides the ability
to share objects with tasks that are not in your direct lineage,
and also allows you to share additional memory with tasks in your
direct lineage after those tasks are created.
The other form of named entry, the submap, is used to group
a set of mappings. The most common use of a submap is to share mappings
among multiple Mach tasks. A submap can be created with vm_region_object_create
.
What makes a submap particularly powerful is that when several tasks have mapped a submap into their address space, they can see each other’s changes to both the data and the structure of the map. This means that one task can map or unmap a VM object in another task’s address space simply by mapping or unmapping that object in the submap.
< Previous PageNext Page > |
Last updated: 2006-11-07
|
Get information on Apple products.
Visit the Apple Store online or at retail locations. 1-800-MY-APPLE Copyright © 2007 Apple Inc. All rights reserved. | Terms of use | Privacy Notice |