Re: [RFC] Driver writer's guide to sleeping

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

 



On 6/25/05, Denis Vlasenko <[email protected]> wrote:
> Hi folks,
> 
> I'm working on a Linux wireless driver.
> 
> I compiled a little guide for myself about waiting primitives.
> I would appreciate if you look thru it. Maybe I'm wrong somewhere.

<snip>
> schedule_timeout(timeout)
<snip>
> msleep(ms)
<snip>
> msleep_interruptible(ms)
<snip>

So, there are four cases in the schedule_timeout() family of sleeps,
based one what you would like to be woken up on:

Signals and Waitqueue events:
     set_current_state(TASK_INTERRUPTIBLE);
     schedule_timeout(some_time_in_jiffies);

Signals only:
     msleep_interruptible(some_time_in_msecs);

Waitqueue events only:
      set_current_state(TASK_UNINTERRUPTIBLE);
      schedule_timeout(some_time_in_jiffies);

Neither signals nor waitqueues:
      msleep(some_time_in_msecs);

Hopefully that clears some things up.

w.r.t to wait-queue event sleeping, you probably should also be aware
of the wait_event() family of macros.

Thanks,
Nish
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux