Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I delay threads using pthread?  (posix standard)

Posted on 2004-09-24
2
Medium Priority
?
3,357 Views
Last Modified: 2013-11-15
I'm wondering how I can delay a thread for a certain amount of time by not using the pthread_delay_np(&ts) command, since it doesnt forfill posix standard. Can I do something with pthread_cond_timedwait() and a semaphore or mutex that wont be used for another thing than just this purpose?
or is there another way? does sleep() suspends the hole process or just a thread, can it be used or is there some other command that only suspends the thread?
0
Comment
Question by:Rawer
  • 2
2 Comments
 
LVL 45

Assisted Solution

by:sunnycoder
sunnycoder earned 2000 total points
ID: 12141395
Hi Rawer,

Use sleep()

Sunnycoder
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 2000 total points
ID: 12141402
I had faced the same problem, and sleep will only make your thread sleep not the whole process
Initially I was planning to use alarms. You can find the discussion here
http://www.experts-exchange.com/Programming/Programming_Languages/C/Q_20639147.html
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One-stop solution for Exchange Administrators to address all MS Exchange Server issues, which is known by the name of Stellar Exchange Toolkit.
While Plesk offers many potential benefits to website administrators, including compatibility with Windows Server and other leading technologies, the company has also been working to differentiate it from other control panels for content management…
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question