Boost logo

Boost :

Subject: Re: [boost] [interprocess] sharing memory between 32 bit and 64 bit Windows processes
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2011-01-18 12:36:43


El 18/01/2011 13:02, Arno Schödl escribió:
> Hello Ion,
>
> I also need this functionality badly. Is there any chance of you
> implementing it? Basically, using unsigned int instead of size_t and
> int instead of ptrdiff_t, so the binary layout of shared memory is
> always like in 32 bit, would in practice do the trick.

I don't think that would work, compiler ABI might have other changes
(Empty Base optimization, new alignment requirementss etc.) for 64 bit
that would break everything. And I don't know the distance between
offset_ptrs created in the stack (eg temporaries) and those in shared
memory. If that distance (I think this depends on which address the OS
reserves to shared memory) is bigger than 2GB, then you are lost.

> If we implement it ourselves, would you support getting this into
> boost? I cannot promise complete support. I already saw that
> rbtree_best_fit has a problem because the ring list containing the
> memory blocks needs to wrap around from the last block to the first.
> Would porting Doug Lea's allocator be an option? It will be hard to
> beat something that has been so thoroughly used and improved.

If the code is good enough ;-) Porting DLMalloc is not easy, It
preallocates some bins for small allocation, and it relies on growing
heap memory. For shared memory this scheme is not very good because you
can't grow the existing space for all processes, but I think you could
adapt it. I don't understand the problem with rb_tree_best_fit.

Best,

Ion


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