![]() |
|
#1
|
|||
|
|||
shared memory and semaphores...here's the deal...
i need two applications that i need to communicate through a shared memory segment... lets say the user starts program A, i need it to create a shared memory segment and a semaphore, when the user stats program B, i need it to attach itself to the segment and the semaphore. i also need it to work the other way around, i cant tell which of the applications the users will start first. i tried using a key for the semphore and the segment but i couldn't get it to work... in both applications this is how i init the shared memory segment and the semaphore: CPP / C++ / C Code:
who do i set the properties that will create a segment if there isnt an segment exist with the key, if the segment exists i want to get the segment id so i could attach to it, same goes for the semaphore... i cant figure it out from the man pages....... thanks in advance for your help... Last edited by dsmith : 15-Feb-2004 at 09:26.
Reason: Added syntax highlighting
|
|
#2
|
||||
|
||||
|
Hello socket. Quick note, gidforums has special codes for C syntax highlighting, if you use [c] and [/c], it will give you purdy highlighed code
![]() I've never used shared app memory like this so I am grasping a little, but have you tried something like this: ***WARNING: UNCOMPILED CODE*** CPP / C++ / C Code:
I haven't looked at the semaphore yet, but you can probably do something similar. Sorry, I can't be of more help. |
Recent GIDBlog
Developing GUIs with wxPython (Part 1) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The