Search:

Type: Posts; User: kumars

Search: Search took 0.01 seconds.

  1. Replies
    22
    Views
    17,853

    Thread Prog in C language (seg fault)

    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...
  2. Replies
    22
    Views
    17,853

    Thread Prog in C language (seg fault)

    "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...
  3. Replies
    22
    Views
    17,853

    Thread Prog in C language (seg fault)

    I have created the structure as follows:




    typedef sturct
    {
    int thread_id;
    int block_id;
    char string[1024];
  4. Replies
    22
    Views
    17,853

    Thread Prog in C language (seg fault)

    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...
  5. Replies
    22
    Views
    17,853

    Thread Prog in C language (seg fault)

    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:...
  6. Replies
    22
    Views
    17,853

    Thread Prog using Shared Memory (single & multiple buffers)

    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...
  7. Replies
    22
    Views
    17,853

    Thread Prog in C language (seg fault)

    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++) {

    ...
  8. Replies
    22
    Views
    17,853

    could you please let me know how to fix it. 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...
  9. Replies
    22
    Views
    17,853

    Thread Prog in C language (seg fault)

    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...
  10. Replies
    22
    Views
    17,853

    Thread Prog in C language (seg fault)

    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...
  11. Replies
    22
    Views
    17,853

    Thread Prog in C language (seg fault)

    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...
  12. Replies
    22
    Views
    17,853

    Thread Prog in C language (seg fault)

    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...
  13. Replies
    5
    Views
    4,256

    It's for AIX and I am new to this OS. Though I...

    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...
  14. Replies
    5
    Views
    4,256

    Shared memory implementation using thread

    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...
Results 1 to 14 of 14