Shared Memmory between process

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
rodrigod
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Thu Jun 26, 2008 8:50 pm

Shared Memmory between process

Post by rodrigod » Wed Aug 05, 2009 8:08 pm

I'd like to share memmory between process that are using the same library on linux.

I am still learning how linux works, So what I want is just if someone has some hints and tips of where to begin what sort of things I should use.

What I need is to share c++ objects between process that use the same shared library. And can I use the wxsemaphores to control the access to this shared area? I mean can wxsemaphore be shared by different processes?

I know this is not a wxWidgets question, but it is the only forum I am a member and I always receive good tips when I ask here.

Thanks

User avatar
doublemax
Moderator
Moderator
Posts: 14984
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax » Wed Aug 05, 2009 8:19 pm

i never needed something like this, but this is where i'd start looking:
http://www.boost.org/doc/libs/1_39_0/do ... esses.html
Use the source, Luke!

rodrigod
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Thu Jun 26, 2008 8:50 pm

Post by rodrigod » Mon Aug 10, 2009 6:17 pm

Thanks after some researching I found out that these are the best (only) way to do this on linux.

But I wouldnt use boost because it is extreamely similar to the native functions, so I dont see way use an external library for it.

One more question, how do I share wxMutex between processes, on linux and windows? Because on the documentation it says that the difference between mutex and criticalsection is that mutex can be sahre between processes and cirticalsection cant.

Thanks

User avatar
doublemax
Moderator
Moderator
Posts: 14984
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax » Mon Aug 10, 2009 7:46 pm

One more question, how do I share wxMutex between processes, on linux and windows?
sorry, no idea.
Use the source, Luke!

rodrigod
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Thu Jun 26, 2008 8:50 pm

Post by rodrigod » Tue Aug 11, 2009 6:42 pm

Actually the application will work a little different on windows and linux, so I would only like to share wxMutex between windows processes.

Using Windows api you need to create a mutex with a name, then you just need to open this mutex using the same name it was created. But if I could do this with wxWidgets it would save me a lot of #ifdef's.

Thanks

Post Reply