Opened 16 years ago

Closed 16 years ago

#669 closed Support Requests (None)

Boost.Multiindex + Boost.Shmem

Reported by: nobody Owned by: joaquintides
Milestone: Component: None
Version: None Severity:
Keywords: Cc:

Description

Hi,

I am trying to get a multiindex to work on a shared
memory using boost.shmem.

After 2 weeks I have already succeeded in creating it
and placing it in a shared but for some strage reason
it won't work when retrieving values.

I think it has to do with the fact that the multiindex
is not using offset_ptr put raw ptrs, though this
shoulnd't be a problem as I am using a fixed address...

Please find the code attached.

You can contact me at bblasi at jblasi.com or post here
as I will chech regulary.

Too much for me this one!

Change History (3)

comment:1 by joaquintides, 16 years ago

Logged In: YES 
user_id=911241

Hello,

I think the problem lies in your code: you forgot to add
a "return" in the implementation of myHash::operator():

class myHash
{
public:
  std::size_t operator()(const MyShmString& v)const
  {
    // no return here!
    boost::hash<std::string>()(v.c_str());
  }
};

I've added the missing return (in both processes'
definition of myHash) and things work OK under
MinGW 3.9, with GCC 3.4.2, Boost 1.33.1 and Shmem 0.93.

Please confirm this also solves things for you.

Best regards,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

comment:2 by nobody, 16 years ago

Logged In: NO 

I am STUPID STUPID STUPID.

I forgot a return!

Thanks a lot Joaquin, you're the best!

comment:3 by joaquintides, 16 years ago

Status: assignedclosed
Note: See TracTickets for help on using tickets.