The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shared memory in shared library DreamWarrior High Level Programming 12 05-30-2007 01:33 PM
memory sharing - not shared memory - elzalem High Level Programming 9 05-02-2007 04:45 AM
Can FD's be shared between threads? ne2000 High Level Programming 2 01-16-2006 01:14 AM
Memory consumption of threads Fong AIX 0 08-02-2005 08:56 AM
Shared memory shortage but lots of unused memory cjcamaro UNIX for Advanced & Expert Users 1 10-13-2004 02:10 PM

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

Join Date: Jun 2008
Posts: 9
Shared memory using threads

I am looking for C program source code. Could you please help me in finding the source code required mentioned below.

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
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:07 AM.


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