libsharedmem Documentation
0.0.4
- Author:
- Jussi Laako
Shared memory object for POSIX/IEEE-1003.1 compliant systems.
Copyright (C) 2005-2007 Nokia Corporation.
Contact: Jussi Laako <jussi.laako@nokia.com>
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Overview
- Main purpose for this library is to provide easy way to share data using standard method of shared memory. It is divided to two parts, shared memory handling and allocation.
- Shared memory handling
- Instance of the sharedmem_t type represents single instance of shared memory block. This is of some specified size rounded up to next page boundary. This block is meant to be fixed size for reasonably long periods of time, preferably for the duration of it's use. It can be resized though. In addition to basic lock/unlock, each block can optionally contain synchronization primitives through pthread_mutex_t and pthread_cond_t.
- Shared memory allocation
- Instance of the sharedmem_alloc_t type represents single instance of allocatable block of shared memory. It's always based on instance of sharedmem_t type object. Size of the parent block defines the size available for allocations within this object. Each allocator object can contain number of malloc(3) like allocations, total size limited by the size of the sharedmem_t type. These can be (re)allocated and freed independent of the original process context. Each allocation provides address offset which can be casted to process-local pointer by use of provided macro, or passed to another process for consumption.
Generated on Thu Sep 13 18:14:21 2007 for libsharedmem by
1.5.1