Page Speed Optimization Libraries
1.13.35.1
|
#include "pthread_shared_mem.h"
Public Member Functions | |
virtual size_t | SharedMutexSize () const |
Size of mutexes inside shared memory segments. | |
virtual AbstractSharedMemSegment * | CreateSegment (const GoogleString &name, size_t size, MessageHandler *handler) |
virtual AbstractSharedMemSegment * | AttachToSegment (const GoogleString &name, size_t size, MessageHandler *handler) |
virtual void | DestroySegment (const GoogleString &name, MessageHandler *handler) |
Public Member Functions inherited from net_instaweb::AbstractSharedMem | |
virtual bool | IsDummy () |
Static Public Member Functions | |
static void | Terminate () |
Frees all lazy-initialized memory used to track shared-memory segments. | |
POSIX shared memory support, using mmap/pthread_mutexattr_setpshared Supports both processes and threads, but processes that want to access it must be results of just fork (without exec), and all the CreateSegment calls must occur before the fork.
This implementation is also not capable of deallocating segments except at exit, so it should not be used when the set of segments may be dynamic.
|
virtual |
Attaches to an existing segment, which must have been created already. May return NULL on failure
Implements net_instaweb::AbstractSharedMem.
|
virtual |
This should be called upon main process/thread initialization to create a shared memory segment that will be accessed by other processes/threads as identified by a unique name (via AttachToSegment). It will remove any previous segment with the same name. The memory will be zeroed out.
May return NULL on failure.
Implements net_instaweb::AbstractSharedMem.
|
virtual |
Cleans up the segment with given name. You should call this after there is no longer any need for AttachToSegment to succeed.
Implements net_instaweb::AbstractSharedMem.