LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 11-24-2012, 07:43 PM   #1
RogueWarrior65
LQ Newbie
 
Registered: Aug 2010
Posts: 16

Rep: Reputation: 0
Question Where is the usleep source code?


Not the best subject line but I'm trying to figure out how the kernel does a usleep.
Specifically, I've been using a 3.0.4 kernel for a while and I get a fairly consistent usleep amount when compared to a hardware timer value (ARM EP9302). But I have been trying several newer kernel versions (and even a newer toolchain) and now usleep varies by as much as 50%. Yes, I know Linux isn't a real time OS but this is pretty awful. ITIMER_REAL is also severely impacted. When I use it to test the kernel Hz value, I'm seeing frequencies as low as 450 Hz and as high as 980 Hz when the kernel is configured for HZ=1000.
 
Old 11-26-2012, 04:19 AM   #2
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,753

Rep: Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271
I found in glibc
http://sourceware.org/git/?p=glibc.g...se/2.16/master
 
Old 11-26-2012, 08:03 PM   #3
RogueWarrior65
LQ Newbie
 
Registered: Aug 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Umm...that's ulimit. I'm talking about usleep.
 
Old 11-27-2012, 02:25 AM   #4
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,753

Rep: Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271
sorry guy, that is simply next to it: http://sourceware.org/git/?p=glibc.g...se/2.16/master
 
1 members found this post helpful.
Old 11-27-2012, 07:45 PM   #5
RogueWarrior65
LQ Newbie
 
Registered: Aug 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Which begs the question: where is __nanosleep?
 
Old 11-28-2012, 12:47 AM   #6
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,753

Rep: Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271Reputation: 1271
it can be found here. Why can't you try to search for it?

http://sourceware.org/git/?p=glibc.g...se/2.16/master

http://sourceware.org/git/?p=glibc.g...41d9cc0cf36842

Last edited by pan64; 11-28-2012 at 12:52 AM.
 
1 members found this post helpful.
Old 11-29-2012, 09:23 AM   #7
RogueWarrior65
LQ Newbie
 
Registered: Aug 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Sadly, that's no help. All __libc_nanosleep does is set ENOSYS which means "function not implemented"
 
  


Reply


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
confused of using usleep & sleep ag2uki Programming 9 07-02-2009 02:01 AM
sleep( ) and usleep( ) problem emp1953 Linux - Newbie 2 03-13-2008 02:50 PM
usleep reduce CPU spikes ? anjanesh Programming 5 06-26-2007 11:02 AM
usleep? kalleanka Programming 5 08-22-2006 07:01 AM
stopping usleep function allomeen Programming 4 12-19-2005 07:23 PM


All times are GMT -5. The time now is 09:58 PM.

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