Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
06-11-2010, 01:27 AM
|
#1
|
|
Member
Registered: Sep 2009
Posts: 48
Rep:
|
How to create a shared memory and some shared objects in linux?
Hi all;
I want to create a "Shared Memory" in linux, then create multiple "Shared Objects" that can access to a Table for example;
And one of them can write something into the Table and the other can access and read it, so that these operations can be handled by programmer!
I'm using Ubuntu 9.04 and I've set it's runlevel at 3 (I have commandline environment now!)
I've searched the Internet so much, but couldn't find a good sample code for this!
I have no experience about it and need your help to introduce me a sample code about it and advise me how to compile and use it with "GCC"?!
Please help me with this, I'm so hurry!!
TIA
|
|
|
|
06-11-2010, 01:28 AM
|
#2
|
|
Member
Registered: Sep 2009
Posts: 48
Original Poster
Rep:
|
How to create a shared memory and some shared objects in linux?
Hi all;
I want to create a "Shared Memory" in linux, then create multiple "Shared Objects" that can access to a Table for example;
And one of them can write something into the Table and the other can access and read it, so that these operations can be handled by programmer!
I'm using Ubuntu 9.04 and I've set it's runlevel at 3 (I have commandline environment now!)
I've searched the Internet so much, but couldn't find a good sample code for this!
I have no experience about it and need your help to introduce me a sample code about it and advise me how to compile and use it with "GCC"?!
Please help me with this, I'm so hurry!!
TIA
|
|
|
|
06-11-2010, 01:37 AM
|
#3
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,848
|
Do not cross-post, it is against the LQ rules.
Continue in this thread
|
|
|
|
06-11-2010, 01:39 AM
|
#4
|
|
Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,861
Rep: 
|
Hi -
You probably want to use the standard "shm*" shared memory API.
Beej's Guide to IPC is an excellent tutorial:
http://beej.us/guide/bgipc/output/ht...age/bgipc.html
'Hope that helps .. PSM
PS:
I'd go easy on the exclamation points in your next post, if I were you
PPS:
Nobody really cares if you're "in a hurry" 
As Pixellany said:
Quote:
|
There are 2 magic words here: "Please" and "Patience"
|
Sage advice, that 
|
|
|
|
06-11-2010, 01:41 AM
|
#5
|
|
Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,861
Rep: 
|
Don't yell "!!!URGENT!!!"
Nobody CARES if you're "so hurry!"
And, as druuna said:
Quote:
Do not cross-post, it is against the LQ rules.
Continue your thread here
|
.
Last edited by paulsm4; 06-11-2010 at 01:44 AM.
|
|
|
|
06-11-2010, 03:50 AM
|
#6
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
jeremy*;
You were warned yesterday not to start duplicate threads. Do not do this again.
I've merged these since both had replies.
<< PS: Moved to Programming (What I thought I was doing when I did the merge.) >>
Last edited by pixellany; 06-11-2010 at 03:55 AM.
|
|
|
|
06-11-2010, 05:21 AM
|
#7
|
|
Senior Member
Registered: Dec 2008
Location: Gurgaon, India
Distribution: OpenSUSE 11.4
Posts: 4,582
|
Quote:
Originally Posted by jeremy28
Hi all;
I want to create a "Shared Memory" in linux, then create multiple "Shared Objects" that can access to a Table for example;
And one of them can write something into the Table and the other can access and read it, so that these operations can be handled by programmer!
....
and advise me how to compile and use it with "GCC"?!
|
See if the following helps you !
http://www.cs.cf.ac.uk/Dave/C/node27.html
and for compiling with gcc see below:
http://luv.asn.au/overheads/compile.html
|
|
|
0 members found this post helpful.
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:54 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|