On Sat, Jan 10, 2009 at 7:01 PM, Bruce Rowen <bro...@aoc.nrao.edu> wrote:
> > On Jan 9, 2009, at 7:21 PM, Peter Teoh wrote: > > hm...i like this problem.....someone got the same problem too: >> >> http://lkml.indiana.edu/hypermail/linux/kernel/0009.3/0906.html >> >> does your problem look similar? >> >> > Not really, but that page is now bookmarked (very interesting!) > > I guess I should have dug deeper. What I find is that delays greater than > one system tick are easy as long as all the possible blocks and preemptions > are considered. Going shorter that one tick (1ms) is basically impossible > without using some form of HW timer and interrupts. Using what I had been > using (spinning on the clock counter register in the CPU) works well enough > and does allow a window for preemption by other threads/interrupts. AFAIK usleep() is indeed implemented by using BogoMIPS value . And usleep internally execute 'nops' for requested period of time, in other words 'usleep' will introduce delay for required period of time without invoking scheduler CMIIAW Thanks, Chetan > > Thanks! > -Bruce > > > > -- > To unsubscribe from this list: send an email with > "unsubscribe kernelnewbies" to ecar...@nl.linux.org > Please read the FAQ at http://kernelnewbies.org/FAQ > >