* Shared Memory using threads in C on AIX @ 2008-06-18 9:59 kumars 2008-06-18 11:26 ` Benoit Fouet 2008-06-18 13:46 ` Glynn Clements 0 siblings, 2 replies; 3+ messages in thread From: kumars @ 2008-06-18 9:59 UTC (permalink / raw) To: linux-c-programming I am looking for C program source code. Could you please help me in finding the source code of the required mentioned below. Task that I need to complete: Write a 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. -- View this message in context: http://www.nabble.com/Shared-Memory-using-threads-in-C-on-AIX-tp17979185p17979185.html Sent from the linux-c-programming mailing list archive at Nabble.com. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Shared Memory using threads in C on AIX 2008-06-18 9:59 Shared Memory using threads in C on AIX kumars @ 2008-06-18 11:26 ` Benoit Fouet 2008-06-18 13:46 ` Glynn Clements 1 sibling, 0 replies; 3+ messages in thread From: Benoit Fouet @ 2008-06-18 11:26 UTC (permalink / raw) To: kumars; +Cc: linux-c-programming Hi, kumars wrote: > I am looking for C program source code. Could you please help me in finding > the source code of the required mentioned below. > > > > Task that I need to complete: > > Write a 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. > > > man pthread.h, you'll find everything you need in there... -- Benoit Fouet Purple Labs S.A. www.purplelabs.com ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Shared Memory using threads in C on AIX 2008-06-18 9:59 Shared Memory using threads in C on AIX kumars 2008-06-18 11:26 ` Benoit Fouet @ 2008-06-18 13:46 ` Glynn Clements 1 sibling, 0 replies; 3+ messages in thread From: Glynn Clements @ 2008-06-18 13:46 UTC (permalink / raw) To: kumars; +Cc: linux-c-programming kumars wrote: > I am looking for C program source code. Could you please help me in finding > the source code of the required mentioned below. The first three external links in the Wikipedia entry for "pthread" are tutorials: http://www.llnl.gov/computing/tutorials/pthreads/ http://yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html http://www-128.ibm.com/developerworks/linux/library/l-posix1.html -- Glynn Clements <glynn@gclements.plus.com> ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-06-18 13:46 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-06-18 9:59 Shared Memory using threads in C on AIX kumars 2008-06-18 11:26 ` Benoit Fouet 2008-06-18 13:46 ` Glynn Clements
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).