Boost logo

Boost Users :

Subject: [Boost-users] [interprocess] 32 to 64 bit ?
From: Stephan Menzel (stephan.menzel_at_[hidden])
Date: 2009-04-09 05:09:48


Hi there,

before holidays kick in I wondered whether I go for a strange problem in my usage of interprocess. Im using it within boost 1.38 on windows, msvc.

Basically, I transfer data between two processes, which works great. So far, both have been built 32 bit release. But now since I exclusively use supposedly safe data types in the shared mem such as boost::uint32_t and friends I was wondering whether it's possible to have the data retrieving process built in 64 bit and access the same buffer.
I just gave it a shot and it behaves different to what I had hoped for.
In blocks during finding a struct with in a shared segment.

ret = segment->find<struct my_buffer>(unique_instance).first;

This operation blocks on a mutex in segment_manager.hpp:

   #ifdef BOOST_INTERPROCESS_RVALUE_REFERENCE
   scoped_lock<rmutex>
   #else
   detail::move_return<scoped_lock<rmutex> >
   #endif
      priv_get_lock(bool use_lock)
   {
      scoped_lock<rmutex> local(m_header, defer_lock);
      if(use_lock){
         local.lock(); // <----- here!
      }
      return local;
   }

.. never to return.
The code is the same as in my 32 - 32 bit versions and known to work. Now I'm wondering, is this supposed to work or is 32 to 64 bit transfer not supported at all? Is this a bug or a feature? Do I have to have both applications in a 64 bit version?

Cheers,

Stephan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net