FBB::SharedSegment(3bobcat)

Shared Memory Data
(libbobcat-dev_6.04.00)

2005-2023

NAME

FBB::SharedSegment - Shared Memory data structure

SYNOPSIS

#include <bobcat/sharedsegment>
Linking option: -lbobcat

DESCRIPTION

The class FBB::SharedSegment implements the shared memory data structure used by Bobcat's shared memory classes. Bobcat's SharedMemory class accesses or defines a shared memory segment, controlling all its read and write operations.

The requested amount of shared memory is always a lower bound to the maximum amount of shared memory that eventually may become available. When defining a SharedSegment object not all of its potentially available shared memory is immediately allocated. Shared memory will be allocated by the SharedSegment object once needed (up to a calculated maximum).

As a fictitious example: assume 100 kB of memory is requested, then the SharedSegment object, maintains a table of, e.g., 10 entries, each controlling the access to a shared memory block of 10 kB. These 10 kB blocks aren't immediately allocated, but become available once the program reads from or writes to addresses located in these data segments.

The class SharedSegment therefore defines a gateway, controlling access to and allocating required shared memory data segments. The mentioned table consists of nBlocks SharedBlock (sharedblock(3bobcat)) values, offering mutexes and IDs of shared data segments. The mutexes control which process has access to a particular block of shared data memory, and the IDs are either -1, meaning that their shared memory data segments has as not yet been allocated, or they contain the IDs of defined shared memory data segments.

The class SharedSegment's sole responsibility is to offer the framework as described. When used by a FBB::SharedMemory object different processes may gain access to different parts of the shared memory data without interfering each other's read and write actions.

NAMESPACE

FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.

INHERITS FROM

-

CONSTRUCTORS

No publicly accessible constructors have been defined for SharedSegment. A static member function create (see below) is available, returning a pointer to a shared memory segment, in which a SharedSegment has been defined.

OVERLOADED OPERATORS

Copy and move constructors (and assignment operators) are not available.

MEMBER FUNCTIONS

STATIC MEMBER FUNCTIONS

EXAMPLE

See the sharedstream(3bobcat) man page.

FILES

bobcat/sharedsegment - defines the class interface

SEE ALSO

bobcat(7), chmod(1), isharedstream(3bobcat), osharedstream(3bobcat), sharedblock(3bobcat), sharedcondition(3bobcat), sharedmemory(3bobcat), sharedmutex(3bobcat), sharedpos(3bobcat), sharedreadme(7bobcat), sharedstream(3bobcat), sharedbuf(3bobcat)

BUGS

None Reported.

BOBCAT PROJECT FILES

BOBCAT

Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.

COPYRIGHT

This is free software, distributed under the terms of the GNU General Public License (GPL).

AUTHOR

Frank B. Brokken (f.b.brokken@rug.nl).