I am able to create multiple threads and a shared memory segment...
Now I want to write into one block of shared memory (need to divide the single shared memory into multiple blocks) as follows:
blockid, threadid, and data.
For example one single block of a shared memory should contain blockid, threadid and data.
where the blockid will be block1, block2, block3 and so on......
threadid will be thread1, thread2, thread3 and so on....
data will be user input data "string format"
Once I am able to write as above, then I should be in a position to read the data from the reader thread by specifying the threadid and blockid and also if the reader threads want to modify the data, so it can modify the data.
On top of it we need to assure that either of the reader thread or writer thread should access any particular block of shared memory at any instance of time, but not both at a time.
I am sending you the code attached along with this post, could you please help me out.....



LinkBack URL
About LinkBacks


