Re: Sleeping Process

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

 



Thanks Nish & Fawad for the reply.

I am checking for pending signal and is able to response to kill -9.

The code is too big to post. Basicaly I am waiting for some data to arrive,

my code checks for the data

check_again:

if  (data is here)
  return data
else
 sleep

goto check_again


From: Fawad Lateef <fawadlateef@xxxxxxxxx>
Reply-To: Fawad Lateef <fawadlateef@xxxxxxxxx>
To: Nish Aravamudan <nish.aravamudan@xxxxxxxxx>
CC: Knowledge Seeker <talibalm@xxxxxxxxxxx>, kernelnewbies@xxxxxxxxxxxx
Subject: Re: Sleeping Process
Date: Thu, 29 Sep 2005 10:15:29 +0500

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/


_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


--
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