Hi Amar.. On 3/24/08, Amar Mudrankit <amar.mudrankit@xxxxxxxxx> wrote: > Hi, > > I want to ask about the new set of kernel thread APIs (kthread_) being > used in kernel. > > In my module, when certain thread was sleeping(TASK_INTERRUPTIBLE > state) and from other thread, I tried to stop this sleeping thread using > kthread_stop. The operation was not successful and kthread_stop did not > return. Is this behaviour expected? > > When I tried to google around it, I found > > http://lwn.net/Articles/118935/ > > which says that kthread_stop doesn't make use of signals to wake up > the sleeping thread and it is expected that sleeping thread should > periodically wake up and check for kthread_should_stop. Is it true? make sense, signal matters for user space, but for kernel thread that won't do much except forcing rescheduling (if kernel space rescheduling is enabled) and setting a flag. Thus, the thread itself must be routinely checking for this flag....in other word, "polling". regards, Mulyadi -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ