On Tue, Nov 30, 2004 at 09:25:11AM -0500, Prokopenko, Konstantyn wrote: > Hello, > > If no external event is there to interrupt your module, you can implement > simple function to sleep number of ticks: > > Note: Each tick = 1000/HZ where HZ = scheduler frequency (defined in > asm/param.h) > > void dev_wait(unsigned long ticks) > { > unsigned long awake = jiffies+ticks; > > current->policy |= SCHED_YIELD > while(awake > jiffies) > schedule(); > } No, what happens when jiffies wraps, directly comparing things with jiffies is not good, please use the wrapper functions for that. Just use schedule_timeout() if you want to do something like this. thanks, greg k-h -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/