Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, I am now studying thread synchronisation going through a book. There are few steps I will follow. I am kinda stuck on the half way through the instructions. Here ...
  1. #1
    Just Joined!
    Join Date
    Aug 2009
    Posts
    6

    thread synchronisation

    Hello,

    I am now studying thread synchronisation going through a book.
    There are few steps I will follow.
    I am kinda stuck on the half way through the instructions.
    Here is the problem.


    It says I have to make the parent thread prompt the user to hit "enter"(and wait for the user to do so) hint: I may need a second mutex for this.

    1. I do not understand why it is can not be done with a single mutex. and how I let the parent thread to wait for the user's input which is a hitting enter.

    2. How I notify from the parent the child one the user has hit the enter key.

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    Which book would that be?

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Just Joined! djap's Avatar
    Join Date
    Jul 2005
    Location
    Not so sure anymore...
    Posts
    97
    You could see here https://computing.llnl.gov/tutorials/pthreads/
    under the section "Condition variables" you can find some material and example about thread synchronisation and signaling.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...