I am trying to divide the shared memory into multiple blocks in such a way that
Problem 1:
writer thread1 should write into first block of shared memory and another thread reader thread1 should...
Type: Posts; User: kumars
I am trying to divide the shared memory into multiple blocks in such a way that
Problem 1:
writer thread1 should write into first block of shared memory and another thread reader thread1 should...
"Codeplug"May I have your kind attention please on this. I don't why my writer function is failing.....
One more question I would like to ask on this....
You can continue to use that as an...
I have created the structure as follows:
typedef sturct
{
int thread_id;
int block_id;
char string[1024];
Many many thanks to you for providing hints. But I have no idea/clue that how I'll pass this structure to writer thread, and once I am able to pass this structure to writer thread and the writer...
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:...
Dear All,
Any Clue on this... I am trying to implement the features (mentioned below) in the code which is already posted in previous message.
Imagining that there are four threads - 2 writers...
I am not sure, but what I believe is that for each writer I am creating 3 shared memory segments.
like for each writer I am creating
for(i = 0; i < num_writers; i++) {
...
could you please let me know how to fix it. I have given up on this.
It works fine when I give the input as follows:
./main -r 300 -w 3 -s 100
./main -r 600 -w 3 -s 1000
(-r option is fine...
I have changed few lines as you've suggested and the changes which I made are as follows:
a) if(pthread_attr_setdetachstate(&newattr, PTHREAD_CREATE_JOINABLE))
changed above line from...
Thanks for pointing me towards right direction. The piece of code "PTHREAD_CREATE_UNDETACHED" I'll change it to "PTHREAD_CREATE_JOINABLE". But as far as I remember once I have commented these lines...
Actually I have sent you a piece of code. Here is the complete program to have a look at it.
I am able to run it successfully
./main -r 300 -w 3 -s 100
./main -r 100 -w 2 -s 100
./main -r...
Could anyone please help me in finding out the reason behind segmentation fault. This program is working fine as long as the command line input is as follows:
./test -r 300 -w 3 -s 100 (gives...
It's for AIX and I am new to this OS. Though I have written two separate functions but unable to compile it. I have created an structure and two threads one for reading and another for writing. But...
Hi
I am looking for C program source code. Could you please help me in finding the source code required mentioned below.
Task that I need to complete:
Write a program to create multiple...