Solved

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

Posted on 2004-09-24
2
3,266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
This video demonstrates basic masking and how to edit the mask to reveal the desired image.
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.

752 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