Re: Sleeping Process

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

 



On 9/29/05, Nish Aravamudan <nish.aravamudan@xxxxxxxxx> wrote:
> On 9/28/05, Knowledge Seeker <talibalm@xxxxxxxxxxx> wrote:
> > Code in my module in running on the behave of a process and I have called
> > scedule_timeout, code freg
> > sleep_time = 5000;
> > set_current_state(TASK_INTERRUPTIBLE);
> > schedule_timeout(sleep_time);
> >
> > I can do ps and it show
> >
> > 4016 pts/0    S+     0:00 ./cda_select_null
> >
> > But, when I do kill
> >
> > kill -9 4016
> >
> > Process doe not get killed.
> >
> > What do I need to do to kill the process ?
>
> If you really want interrupts to end the kernel-side of the process, then add
>
> if (signal_pending(current))
>    return -EINTR;
>
> after schedule_timeout() returns.
>
> To really help, by the way, we need to see all the code involved.
>

the thing is you can't kill kernel process/thread until you have
signal_pending condition check and return from the thread/process on
occurence of that condition ......... so if you send signal to thread
(might be from user space using kill -9 ) then signal_pending will
evaluate to true and your thread will be terminated due to return
statement ............

By the way posting code in detail will get you help more correctly .....

--
Fawad Lateef

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux