Loading
Shared Memory using thread in C on AIX
Jun 18, 2008 By kumars
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.
Trending Topics
| You Need A Budget | Feb 10, 2012 |
| The Linux powered LAN Gaming House | Feb 08, 2012 |
| Creating a vDSO: the Colonel's Other Chicken | Feb 06, 2012 |
| Your CMS Is Not Your Web Site | Feb 01, 2012 |
| Casper, the Friendly (and Persistent) Ghost | Jan 31, 2012 |
| Razor-qt 0.4 - Qt based Desktop Environment | Jan 30, 2012 |
- Fun with ethtool
- Parallel Programming with NVIDIA CUDA
- Readers' Choice Awards 2011
- 100% disappointed with the decision to go all digital.
- Linux-Based X Terminals with XDMCP
- Validate an E-Mail Address with PHP, the Right Way
- You Need A Budget
- The Linux powered LAN Gaming House
- Why Python?
- Python for Android
- Employment Posters
3 hours 35 min ago - Sure the best distro is
4 hours 55 min ago - BeOS was the best
7 hours 38 min ago - I use Wireshark on a daily
12 hours 9 min ago - buena información
17 hours 16 min ago - One important "bucket" that I didn't note (désolé si qqun deja d
18 hours 16 min ago - Gnome3 is such a POS. No one
1 day 3 hours ago - Gnome 3 is the biggest POS
1 day 3 hours ago - I didn't knew this thing by
1 day 9 hours ago - Author's reply
1 day 13 hours ago





thats a tiny program.you can
thats a tiny program.you can write it by yourself.
for example:
in example.c...
function main() is the master function.worker1()&worker2() run as worker thread.
they share a buffer which defined as global var at the beginning.
the buffer need a synchronous lock.
lock it before read or write,and unlock it after read or write.