Solved

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

Posted on 2004-09-24
2
3,124 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 500 total points
ID: 12141395
Hi Rawer,

Use sleep()

Sunnycoder
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This video demonstrates basic masking and how to edit the mask to reveal the desired image.
Viewers will learn how to use the Hootsuite Dashboard.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now