Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2006-02-10 08:36:49


Feature request to make fixed base adress usable.

Generally it is impossible to ensure newly created shared memory
will be mapped into the same address, because the address
space gets get fragmented almost instantly.

I have used one workaround:

* create dummy main executbale that does nothing
   but creates/opens shared memory at given address.

* Since the process does nothing else (no other DLLs
   loaded, no dynamic allocations, no statics
  initialisation, nothing) it is ensured this request
  will succeed.

* then a DLL with the main application code is
  called and passed the shared memory.
  This DLL does all the work, loads all
   other DLLs etc.

Shmem may provide function open()
which takes ownership of existing shared memory,
as if it was created there.

The difference from use supplied buffer is
that lifetime management of shared memory
block is kept inside the library.

The trick could be nice item in "How do I..."
hints page.

/Pavel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk