Find the answer to your Linux question:
Results 1 to 2 of 2
I am creating a program which will have 2 threads. I want two of them to suspend themselves for a fixed period of time (which is different for both of ...
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Posts
    13

    pthreads , signals and alarm

    I am creating a program which will have 2 threads. I want two of them to suspend themselves for a fixed period of time (which is different for both of them).
    They have to be woken up by an alarm /SIGALRM/ set timer or something similar.

    How do I do it?

    I am using Linux with pthreads library

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Use sigtimedwait(); google it to find out how.

    But see also my answer here.
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

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