Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-20-2009, 06:00 AM   #1
LQ Newbie
Registered: Mar 2009
Posts: 28

Rep: Reputation: 15
Max. Value that could be passed to an udelay() function

Is there any limit in the value that we pass as argument to an udelay() function???i.e can we specify something like this:udelay(2000)??

With Regds
Old 04-20-2009, 08:38 AM   #2
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
It's at least the unsigned long max value, 2000 would be OK, more over, depending on your kernel, this value could be rounded (up or down, don't remember) to the closest jiffy value.
Old 04-20-2009, 08:44 AM   #3
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
Oh sorry, I was thinking about usleep... So in fact that's true, you must use the good delay function, depending on the time you want to sleep: ndelay for ns, udelay for us and mdealy for ms scale, so use "mdelay (2)" instead. BUT it's a busy waiting, that means that noting else can be done during this time, you'd better use (if possible) one of the "sleep" family functions. look here: chapter 7


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Parenthesis and other odd characters passed to bash function jakeo25 Programming 2 04-03-2008 10:27 AM
Using C API; first query passed passed by program to MySQL is successful, second quer weibullguy Programming 2 06-12-2007 10:45 PM
Array structs - passed to function cdog Programming 4 02-02-2006 03:07 PM > Forums > Linux Forums > Linux - Newbie

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

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