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

PsnMomeWeakMemoryManager Class Reference

isn't used anymore More...

#include <PsnMomeWeakMemoryManager.h>

Inheritance diagram for PsnMomeWeakMemoryManager:

Inheritance graph
[legend]
Collaboration diagram for PsnMomeWeakMemoryManager:

Collaboration graph
[legend]
List of all members.

Public Methods

 PsnMomeWeakMemoryManager (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 ~PsnMomeWeakMemoryManager ()
 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, Strong, Relaxed }
 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

bool hasCorrectAccessRights (unsigned int addr)
 Make sure a memory zone spawns pages with correct access rights.


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

CurrentAllocator::accessRights * tabDroits
 le tableau de l'état de la page vu par le processus local

size_t numberOfPages
 le nombre de pages gérée

list< unsigned int > toBeRelaxed [2]
 double buffer of the list of pages whose coherance needs to be relaxed after the next sync

list< unsigned int > toBeFreed [2]
 double buffer of the list of pages who have to be freed after the next sync

int currentRelaxedToken
 index of the list to be used at the next sync to know the page numbers to be relaxed after the next sync

int currentFreableToken
 index of the list to be used at the next sync to know the page numbers to be freed

unsigned int maxAllocatedPage
 max of page numbers where memory is allocated (unused because unshared)


Friends

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


Detailed Description

isn't used anymore

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

Definition at line 33 of file PsnMomeWeakMemoryManager.h.


Member Enumeration Documentation

enum PsnMomeWeakMemoryManager::coheranceType [protected]
 

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

Enumeration values:
None 
Strong 
Relaxed 

Definition at line 69 of file PsnMomeWeakMemoryManager.h.

00069 { None , Strong , Relaxed } ;


Constructor & Destructor Documentation

PsnMomeWeakMemoryManager::PsnMomeWeakMemoryManager 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 PsnMomeWeakMemoryManager::~PsnMomeWeakMemoryManager   [virtual]
 

destructeur


Member Function Documentation

virtual void PsnMomeWeakMemoryManager::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 PsnMomeWeakMemoryManager::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* PsnMomeWeakMemoryManager::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* PsnMomeWeakMemoryManager::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.

bool PsnMomeWeakMemoryManager::hasCorrectAccessRights unsigned int    addr [inline, protected]
 

Make sure a memory zone spawns pages with correct access rights.

You can only allocated memory if the page is marked non allocated or strong allocated but with access rights not to be relaxed after the next sync. If memory in the page has allready been partially allocated (it isn't free in tabDroits), the current allocator must be the same one as the previous one.

virtual int PsnMomeWeakMemoryManager::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* PsnMomeWeakMemoryManager::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 PsnMomeWeakMemoryManager::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 PsnMomeWeakMemoryManager::showMemory void    [virtual]
 

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

Reimplemented from PsnMomeMemoryManager.

virtual void PsnMomeWeakMemoryManager::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 PsnMomeWeakMemoryManager::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 PsnMomeWeakMemoryManager.h.


Member Data Documentation

int PsnMomeWeakMemoryManager::currentFreableToken [protected]
 

index of the list to be used at the next sync to know the page numbers to be freed

Definition at line 89 of file PsnMomeWeakMemoryManager.h.

int PsnMomeWeakMemoryManager::currentRelaxedToken [protected]
 

index of the list to be used at the next sync to know the page numbers to be relaxed after the next sync

Definition at line 87 of file PsnMomeWeakMemoryManager.h.

unsigned int PsnMomeWeakMemoryManager::maxAllocatedPage [protected]
 

max of page numbers where memory is allocated (unused because unshared)

Definition at line 91 of file PsnMomeWeakMemoryManager.h.

size_t PsnMomeWeakMemoryManager::numberOfPages [protected]
 

le nombre de pages gérée

Definition at line 79 of file PsnMomeWeakMemoryManager.h.

coheranceType* PsnMomeWeakMemoryManager::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 PsnMomeWeakMemoryManager.h.

CurrentAllocator::accessRights* PsnMomeWeakMemoryManager::tabDroits [protected]
 

le tableau de l'état de la page vu par le processus local

Definition at line 77 of file PsnMomeWeakMemoryManager.h.

const PsName* * PsnMomeWeakMemoryManager::tabOwner [protected]
 

le tableau des propriétaires de pages (on ne connait sa taille qu'à la création

Definition at line 75 of file PsnMomeWeakMemoryManager.h.

list<unsigned int> PsnMomeWeakMemoryManager::toBeFreed[ 2 ] [protected]
 

double buffer of the list of pages who have to be freed after the next sync

Definition at line 85 of file PsnMomeWeakMemoryManager.h.

list<unsigned int> PsnMomeWeakMemoryManager::toBeRelaxed[ 2 ] [protected]
 

double buffer of the list of pages whose coherance needs to be relaxed after the next sync

Definition at line 83 of file PsnMomeWeakMemoryManager.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