LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-09-2005, 06:11 AM   #1
geethu
LQ Newbie
 
Registered: Jul 2005
Location: India
Posts: 10

Rep: Reputation: 0
Probelm regarding multithreaded program?


Hi,

How can one make a particular thread wait for some interval and later resume the thread without disturbing other threads in an multithreaded program?
Since i am using pthread functions, it will be helpful if i know the function from pthread APIs.
or
Is there any other way to acheive this?

Thanks,
Geethu
 
Old 08-09-2005, 07:34 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
You can use the sleep/usleep function.

Check you man 3 sleep and man 3 usleep for more information.

btw... I'm moving this to programming since it is more of a programming type question.
 
Old 08-10-2005, 12:39 AM   #3
geethu
LQ Newbie
 
Registered: Jul 2005
Location: India
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for the reply.

I tried using sleep & usleep functions, didn't get the result i was expecting for because this functions were putting the thread which i wanted to suspend for some intervals including other threads too.Also processes were put into sleep.

Can you suggest any other function which can suspend only the thread i want without affecting other threads and processes in my application?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does a multithreaded program gets hanged at recvfrom()? kranti Programming 1 10-17-2005 10:44 AM
Why does a multithreaded program gets hanged at recvfrom()? kranti Linux - Newbie 1 10-17-2005 04:40 AM
Why does a multithreaded program gets hanged at recvfrom()? kranti Linux - General 1 10-17-2005 04:09 AM
Debugging Multithreaded Program villie Programming 2 08-17-2004 11:24 AM
Signal handling in Multithreaded program souvik Programming 4 08-23-2002 07:28 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration