PDA

View Full Version : share memory



petersmith01115
March 13th, 2011, 04:44 PM
Hi, I need some clarification on:

a. How we can setup two processes so they share memory.
b. How we can setup two threads so they share memory.

Thank you.

PaulM1985
March 13th, 2011, 04:58 PM
I am not sure how you can share memory on different processes. Perhaps storing information in file, or into a database and then the other process can read that information. The memory shared would not be in RAM, but some persistent storage.

You can share RAM memory with different threads. This is going to be specific to the language that you are working with, but take Java as an example, you can have two threads acting on the same object, so they are acting on the same thing in memory.

You question is pretty vague. What exactly are you trying to do?

Paul

Arndt
March 13th, 2011, 05:15 PM
Hi, I need some clarification on:

a. How we can setup two processes so they share memory.
b. How we can setup two threads so they share memory.

Thank you.

What have you read so far?

MadCow108
March 13th, 2011, 05:35 PM
a) http://beej.us/guide/bgipc/output/html/multipage/shm.html
b) threads always share memory as they are in the same process

rnerwein
March 14th, 2011, 04:20 PM
a) http://beej.us/guide/bgipc/output/html/multipage/shm.html
b) threads always share memory as they are in the same process
high
that the shm.html is right. but be care for touching the "ftok" file because it's made of access time and ....
ciao