Re: Timer Granularity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> check out the posix high-res timers project

sorry, maybe im just trolling, but the posix high-res stuff is crap.  read the 
man page on nanosleep, and you find it still is limited to the 10ms thing 
(note, 10ms is on x86. it's 1ms on alpha i think).  with special scheduling, 
you can get 2ms, which would be cool.  but, to get scheduling, you need 
capabilities, which is awful to go through.  further, it is not well documented 
(at least i havnt found any docs.  im sure they exist, and links will be sent.  
thanks to those of you =).  capabilities isn't really needed, but it allows you 
to see if you are even allowed to reschedule (i haven't seen this priv in any 
distro, nor do i know how to set it.  my ignorance is probably a large part of 
the problem)

so, ultimatly, unless you are root, and can reschedule you app (man 
sched_setscheduler), nanosleep us just as useless as usleep in terms of high 
resolution timing.

sorro for the grim outlook =(  i'm hoping this can some how be changed.

preemptive kernels may not suffer from the timing stuff (i've only tested on 
2.2.x's), so this may all be null and void if it's already been resolved. (in 
which case i will most certainly look dumb :^)

some success can be had by using a lot of threads, each installing a timer 
(setitimer) and signal handlers (sigaction).  not very precise, but it could go 
somewhere if you work with it.

ttyl
chris


---
"Civil liberties are the most important gift this country has to offer to It's 
people.  Nothing can be more import...  oh look, a quarter!"

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux