Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    in multithread program,How to make one of the threads sleeping while the others run normally?

    the program have 3 threads , now I want the first thread sleeping ,but the other two should run normally , if I call the sleep() function ,the process sleep ,so all the threads get sleeping , Can anyone tell me how to resolve it ?

  2. #2
    from pthread man pages:
      pthread_suspend()        This function is used to temporarily stop the
                                   execution of a thread.
               These functions cause a previously suspended thread to continue

  3. #3
    thanks for your help ,
    but I cannot find the declaration of the pthread_suspend() function on my system which runs redhat linux 9.0 , is it necessary to update the pthread library to the latest version ?

  4. $spacer_open
  5. #4
    Linux Newbie
    Join Date
    Jul 2005
    In java Thread.sleep() makes only the thread callig that function sleep
    Also i think the suspend and resume functions in java are depricated because of resuming problems

    Dont know about C 's suspend and resume
    The strong shall live and the weak will die
    In the end,only the fittest survive in this world
    - Shishio Makoto

Posting Permissions

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