
1 Apr
2009
1 Apr
'09
4:58 p.m.
Casimiro, Daniel C CIV NUWC NWPT wrote:
To do this, I first create a shared segment and then a dynamic area in it. like this:
struct transfer_buffer { void *buf; size_t bufsize; boost::interprocess::interprocess_mutex mutex; size_t dmember; }
I only quickly looked at your code, but I think that your void* pointer is invalid in the second process.
Take a look at boost::interprocess::offset_ptr and use it in place of void*.
~Dan
Thanks for the quick reply, Dan. Yes, all pointers placed in shared memory should be offset_ptr as explained here: http://www.boost.org/doc/libs/1_38_0/doc/html/interprocess/sharedmemorybetwe... Regards, Ion