Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 20th October 2011, 08:39 PM
kalzoubi Offline
Registered User
 
Join Date: Apr 2011
Posts: 27
linuxfirefox
short delays

Hi,

I am trying to do short delays (e.g. 400 Microseconds). I used my own busy-waiting function and Linux nanosleep. However, the problem is that the delay time varies from a call to another. For the example, the following code takes different times to execute ranges from 187 usec to 300 usec:

gettimeofday(&tvBegin, NULL); // begin
for (double d = 0; d < 50000; d++); // busy waiting
gettimeofday(&tvEnd, NULL); //end

I understand the process may be preempted during the busy wait. One of the solutions I tried is to set the process priority to -1 since all of my other processes are set to 0. But, it didn't work.

How can I get my busy wait code to take the same time to execute?

Any feedback is highly appreciated.

Thanks.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
automount and delays fizzix Using Fedora 0 7th November 2005 05:01 PM
what's with the fedora.us delays? Aardvark Freak Using Fedora 3 29th November 2004 12:11 AM


Current GMT-time: 09:28 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat