On 7/7/07, pradeep singh <2500.pradeep@xxxxxxxxx> wrote:
On 7/6/07, Jesper Juhl <jesper.juhl@xxxxxxxxx> wrote: > On 06/07/07, Bhanu Kalyan Chetlapalli <chbhanukalyan@xxxxxxxxx> wrote: > > On 7/6/07, hari krishna angadi <reachtohari@xxxxxxxxx> wrote: > > > hi all, > > > I am porting from 2.4 to 2.6, There is a problem, a user space > > > code which should be pushed to kernel space(driver module). In the user > > > program there is a nanosleep() function i need to know the respective > > > kernel routine for nanosleep. > > > > kernel does not have something like sleep, it just schedules a new > > process in that time. > > Not true, you have udelay(), ndelay(), mdelay(), msleep(), ssleep() > and the *_interruptible() versions... > > So you do have functions to delay or sleep in the kernel. Jesper, AFAICT they both are *not* same. Please CMIIW.
If by "both" you mean sleeping and delaying, yes, there is a difference. One sleeps (that would be "sleeping") while one waits (or busy-waits) (that would be "delaying"). So they can be used in some contexts (generally delaying is always possible, but frowned upon because it "wasting" CPU, especially for long durations) and not in others (generally "sleeping" has to be careful about atomicity and such.). Thanks, Nish -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ