Click here to Skip to main content
15,671,266 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
how to share memory in ubuntu using c++
Sergey Alexandrovich Kryukov 26-Feb-15 12:34pm    
What have you tried so far?

You can use POSIX shared memory objects (shm*). Please start here:[^].

Good news for you: nothing of this is specific to Ubuntu, and not even exclusively to Linux. Please see also:[^].

Share this answer
CPallini 26-Feb-15 13:13pm    
Sergey Alexandrovich Kryukov 26-Feb-15 15:17pm    
Thank you, Carlo.
It depends on your needs. Sergey already pointed out how to share memory between processes.
In another scenario, memory is shared between different threads of the same process and all you have to do is synchronize the access to it (see, for instance
"Mutex Variables" at POSIX Threads Programming page
Share this answer
Sergey Alexandrovich Kryukov 26-Feb-15 15:18pm    
I took sharing memory between threads of the same process for granted, but it is still possible that the inquirer needs at least the mention. 5ed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900