Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PsnMomePagedWeakMemoryManager Class Reference

Classe de gestion de mémoire partagée à cohérance faible. More...

#include <PsnMomePagedWeakMemoryManager.h>

Inheritance diagram for PsnMomePagedWeakMemoryManager:

Inheritance graph
[legend]
Collaboration diagram for PsnMomePagedWeakMemoryManager:

Collaboration graph
[legend]
List of all members.

Public Methods

 PsnMomePagedWeakMemoryManager (void *startDsm, size_t sizeDsm, size_t pageSize, PsnUniqueCreator *creator)
 A n'appeler qu'en exclusion mutuelle sur la zone mémoire gérée par PsnMemoryElementDescriptor::myMemoryManager.

virtual ~PsnMomePagedWeakMemoryManager ()
 destructeur

virtual void * mmalloc (size_t size)
 allocation d'une zone de mémoire dans la zone de mémoire à cohérance relachée.

virtual int mfree (void *addr, size_t size)
 free the memory at addr.

virtual PsnMemoryElementDescriptorgetFreeMem ()
 redefine getFreeMem so as to get the address of the list of the free elements of this memory manager

virtual void setFreeMem (PsnMemoryElementDescriptor *ptr)
 redefine setFreeMem to change the fisrt element of the list of free elements for this memory manager

virtual void sync ()
 Synchronize the memory managed by the memory manager, in a relaxed fashion : any memory page marked as relaxed is synchronized only to an older version (the one available at the last barrier).

virtual void strongSync ()
 Strong synchronisation of all memory pages where memory has been allocated.

virtual void * get_from_free (size_t size)
 la zone de mémoire dans lesquels sont stockés les PsnMemoryElementDescriptor doit être vérouillée avant l'appel à cette fonction.

virtual void add_in_free (void *addr, size_t size)
 la zone de mémoire dans lesquels sont stockés les PsnMemoryElementDescriptor doit être vérouillée avant l'appel à cette fonction

virtual void showMemory (void)
 pour cause de Debug, montrer l'état de la mémoire


Protected Types

enum  coheranceType { None, AlwaysSynchronized, StepSynchronized }
 le type enuméré gérant la cohérance de la page More...


Protected Methods

virtual void divideBlockFor (size_t size)
 divide a free block between a part starting on a free page and the rest


Protected Attributes

coheranceTypetabCoherance
 La table, a allouer dans la mémoire partagée, de la cohérance à avoir pour chaque page.

const PsName ** tabOwner
 le tableau des propriétaires de pages (on ne connait sa taille qu'à la création), de façon à n'avoir qu'un écrivain par page

size_t numberOfPages
 le nombre de pages gérée

const int _nbMinor
 number of pages on wich to cycle cohérance


Friends

class PsnUniqueCreator
 pour que le createur {PsnUniqueCreator} connaisse le type enumeré


Detailed Description

Classe de gestion de mémoire partagée à cohérance faible.

Author:
basé sur un code fournit par Renaud Lottiaux.
Version:
0.1

Definition at line 33 of file PsnMomePagedWeakMemoryManager.h.


Member Enumeration Documentation

enum PsnMomePagedWeakMemoryManager::coheranceType [protected]
 

le type enuméré gérant la cohérance de la page

Enumeration values:
None 
AlwaysSynchronized 
StepSynchronized 

Definition at line 69 of file PsnMomePagedWeakMemoryManager.h.


Constructor & Destructor Documentation

PsnMomePagedWeakMemoryManager::PsnMomePagedWeakMemoryManager void *    startDsm,
size_t    sizeDsm,
size_t    pageSize,
PsnUniqueCreator   creator
 

A n'appeler qu'en exclusion mutuelle sur la zone mémoire gérée par PsnMemoryElementDescriptor::myMemoryManager.

virtual PsnMomePagedWeakMemoryManager::~PsnMomePagedWeakMemoryManager   [virtual]
 

destructeur


Member Function Documentation

virtual void PsnMomePagedWeakMemoryManager::add_in_free void *    addr,
size_t    size
[virtual]
 

la zone de mémoire dans lesquels sont stockés les PsnMemoryElementDescriptor doit être vérouillée avant l'appel à cette fonction

Reimplemented from PsnMomeMemoryManager.

virtual void PsnMomePagedWeakMemoryManager::divideBlockFor size_t    size [protected, virtual]
 

divide a free block between a part starting on a free page and the rest

Reimplemented from PsnMomeMemoryManager.

virtual void* PsnMomePagedWeakMemoryManager::get_from_free size_t    size [virtual]
 

la zone de mémoire dans lesquels sont stockés les PsnMemoryElementDescriptor doit être vérouillée avant l'appel à cette fonction.

Reimplemented from PsnMomeMemoryManager.

virtual PsnMemoryElementDescriptor* PsnMomePagedWeakMemoryManager::getFreeMem   [virtual]
 

redefine getFreeMem so as to get the address of the list of the free elements of this memory manager

Returns:
the address of the first element of the list.

Reimplemented from PsnMomeMemoryManager.

virtual int PsnMomePagedWeakMemoryManager::mfree void *    addr,
size_t    size
[virtual]
 

free the memory at addr.

Does all the bookkeeping so as to free any page which becomes totally free.

Parameters:
addr adress of the memory to be freed
size size of the memory to be freed.

Reimplemented from PsnMomeMemoryManager.

virtual void* PsnMomePagedWeakMemoryManager::mmalloc size_t    size [virtual]
 

allocation d'une zone de mémoire dans la zone de mémoire à cohérance relachée.

En plus de l'appel à mmalloc de l'ancêtre, this method marks the pages allocated in the different page tables. In particular, any pages allocated for the first time by this method, is marked so as at the next sync on any process, the last version of the page is asked for.

Reimplemented from PsnMomeMemoryManager.

virtual void PsnMomePagedWeakMemoryManager::setFreeMem PsnMemoryElementDescriptor   ptr [virtual]
 

redefine setFreeMem to change the fisrt element of the list of free elements for this memory manager

Parameters:
ptr address of the new first element of this list

Reimplemented from PsnMomeMemoryManager.

virtual void PsnMomePagedWeakMemoryManager::showMemory void    [virtual]
 

pour cause de Debug, montrer l'état de la mémoire

Reimplemented from PsnMomeMemoryManager.

virtual void PsnMomePagedWeakMemoryManager::strongSync   [virtual]
 

Strong synchronisation of all memory pages where memory has been allocated.

This calls a synchronization barrier, ans then asks for the last version of the pages available at the time of the barrier.

virtual void PsnMomePagedWeakMemoryManager::sync   [virtual]
 

Synchronize the memory managed by the memory manager, in a relaxed fashion : any memory page marked as relaxed is synchronized only to an older version (the one available at the last barrier).

A synchronisation barrier is then made between all processes and all the memory pages mark as strong are synchronized to the version available at the time of the synchronization barrier, and prefetched.


Friends And Related Function Documentation

friend class PsnUniqueCreator [friend]
 

pour que le createur {PsnUniqueCreator} connaisse le type enumeré

Definition at line 67 of file PsnMomePagedWeakMemoryManager.h.


Member Data Documentation

const int PsnMomePagedWeakMemoryManager::_nbMinor [protected]
 

number of pages on wich to cycle cohérance

Definition at line 79 of file PsnMomePagedWeakMemoryManager.h.

size_t PsnMomePagedWeakMemoryManager::numberOfPages [protected]
 

le nombre de pages gérée

Definition at line 77 of file PsnMomePagedWeakMemoryManager.h.

coheranceType* PsnMomePagedWeakMemoryManager::tabCoherance [protected]
 

La table, a allouer dans la mémoire partagée, de la cohérance à avoir pour chaque page.

Definition at line 71 of file PsnMomePagedWeakMemoryManager.h.

const PsName* * PsnMomePagedWeakMemoryManager::tabOwner [protected]
 

le tableau des propriétaires de pages (on ne connait sa taille qu'à la création), de façon à n'avoir qu'un écrivain par page

Definition at line 75 of file PsnMomePagedWeakMemoryManager.h.


The documentation for this class was generated from the following file:
logo OpenMask

Documentation generated on Mon Nov 25 15:26:10 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001