LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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



Reply
 
Search this Thread
Old 09-25-2010, 11:33 AM   #1
davidschiff
LQ Newbie
 
Registered: Sep 2010
Posts: 3

Rep: Reputation: 0
Question Shared Memory & Semaphores & Array of Structures


Hi there,

I am having a hard time with the code below. If anyone can provide any ideas on how to solve that would be great.

Thank you.

Regards,
David

Last edited by davidschiff; 09-26-2010 at 12:18 PM. Reason: Changed <code> to [code]
 
Old 09-25-2010, 04:11 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,539

Rep: Reputation: 149Reputation: 149
Where exactly you register the area as shared? I can't find it in this code.
 
Old 09-25-2010, 05:16 PM   #3
davidschiff
LQ Newbie
 
Registered: Sep 2010
Posts: 3

Original Poster
Rep: Reputation: 0
More Code

Thank you.

Last edited by davidschiff; 09-26-2010 at 12:18 PM. Reason: Changed <code> to [code]
 
Old 09-25-2010, 05:18 PM   #4
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi, Davidschiff -

Strong suggestion: please write a little "hello world" test for shared memory before you go off and try to debug your implementation. I honestly believe a small program would be EXTREMELY helpful.

You might also be interested in Beej's Guide: it's a WONDERFUL introduction to *nix IPCs (InterProcess Communications), with some great insights into shared memory and semaphores:

http://beej.us/guide/bgipc/output/ht...ipage/shm.html
http://beej.us/guide/bgipc/

PS:
Linux Question's "code" blocks use square brackets ("[code]...") instead of "<code>".

Last edited by paulsm4; 09-25-2010 at 05:23 PM.
 
Old 09-25-2010, 05:30 PM   #5
davidschiff
LQ Newbie
 
Registered: Sep 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by paulsm4 View Post
Hi, Davidschiff -

Strong suggestion: please write a little "hello world" test for shared memory before you go off and try to debug your implementation. I honestly believe a small program would be EXTREMELY helpful.

You might also be interested in Beej's Guide: it's a WONDERFUL introduction to *nix IPCs (InterProcess Communications), with some great insights into shared memory and semaphores:

http://beej.us/guide/bgipc/output/ht...ipage/shm.html
http://beej.us/guide/bgipc/

PS:
Linux Question's "code" blocks use square brackets ("[code]...") instead of "<code>".
Well... the function() is supposed to be the "Hello World".

I saw Beej's Guide.

I wasn't able to find too much on the web, in a few books about shmem and general functions for array of structures. Most examples are too simple.

Thank you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Shared memory between Fortran & C++ applications mbrose1994 Linux - Software 1 05-07-2010 03:24 PM
semaphores and shared memory beata86 Programming 1 11-22-2006 06:24 AM
shared memory & semaphores black_man Programming 0 09-22-2006 02:10 AM
Shared Memory/ Semaphores wildem Programming 3 06-20-2005 02:13 PM
shared memory and semaphores... socket9001 Programming 3 02-16-2004 12:18 PM


All times are GMT -5. The time now is 07:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration