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-02-24 04:24:45


El 24/02/2011 9:37, Arno Schödl escribió:

> - Option 3: Actually, the right solution is to make
> offset_ptr::difference_type of a mixed-environment offset pointer 32
> bit, but its internal offset representation 64 bit. So all shared
> size_types and difference_types will be 32 bit, which is correct
> because all array sizes and differences between pointers within
> arrays are limited to 32 bit. For those places where internal
> algorithms (such as the rbtree memory algorithm) need modulo
> arithmetic, we will make a custom typedef in offset_ptr to export the
> "virtual address space size".
>
> Any objection? It would be great if you could give us feedback,
> because we want to get done with that stuff, we need it badly...

Differentiating "shared distances" from other types is easy. Pointer
arithmetics/function parameters, etc. can create temporary pointers with
point from stack to shared memory and this distance will be different in
32 bit (max. 32 bit distance) and 64 systems (max. 64 bit distance!).
The pointer type is the same, so I'm afraid option 3 is not possible.

Option 2 suffers from the same problem. You can make pointers 32 bit but
again 32 bit distance from stack to shared memory might be too short in
64 bit environments.

For options 1, the OS won't let you allocate/connect to memory bigger
than 32 bit limits, so you will get an error when connecting/creating
such shared memory.

Best,

Ion


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