The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
A program to trace execution of another program jiten_hegde High Level Programming 3 08-19-2008 02:26 AM
How to write to stdin of another program (program A -> [stdin]program B) vvaidyan UNIX for Dummies Questions & Answers 3 08-02-2008 02:21 PM
How to write to stdin of another program (program A -> [stdin]program B) vvaidyan High Level Programming 1 04-30-2008 10:44 AM
Program help Kamerin Shell Programming and Scripting 2 09-28-2007 01:06 PM
executing a program within a program Gekko High Level Programming 4 06-27-2002 12:36 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-19-2008
Registered User
 

Join Date: Jun 2008
Posts: 9
C program

Can anyone tell me how to.....

program to create multiple threads (one master thread and rest worker threads) and using the threads write into and read from shared memory


Restrictions:

Only one thread should be able to read at any instant of time into shared memory region.

Only one thread should be able to write at any instant of time into shared memory region.

Worker threads should inform the master thread after every read and write operation.

Master thread inform the worker thread (which is waiting to acquire shared memory region) that read or write operation is successful and it can acquire the memory for either reading and writing operations.
Reply With Quote
Forum Sponsor
  #2  
Old 08-20-2008
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
ok, whats your doubt here ?

Post us what you have tried so far.

What is the difficult here ? How could we help you progress further ?
Reply With Quote
  #3  
Old 09-26-2008
Registered User
 

Join Date: Jun 2008
Posts: 9
Thread prog

I have attached "C program". In the program I am trying to create shared memory. I am also trying to create multiple threads to read and write into shared memory. I am able to create shared memory and number of threads (reader and writer threads) but I am not able to perform read and write operations using the theads.

Could you please check the program and modify it.
Attached Files
File Type: zip shmem_new.zip (4.0 KB, 0 views)
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 01:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0