lkml.org 
[lkml]   [1999]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: waitpid advice ? (killing off a kernel thread)
On Sat, 19 Jun 1999, B. James Phillippe wrote:
> On Sat, 19 Jun 1999, David Waite wrote:
>
> > The problem is that the drivers have threads running that are not dying
> > before I start deallocating resources.
> ...
> > Anyways, my question is.. obviously my method of killing and then waiting
> > for the process to die is not working right. What can I do instead? Wait
>
> I had a similar problem with a modular kernel-thread project that I'm
> working on. I solved it by using a semaphore to coordinate the module
> unloading and thread cleanup. Something like this:

Yes, this is sort of what I have deemed a 'last resort' though, mostly
because releasing the semaphore cannot be done after the thread exits,
only before.. so I will still have a chance of executing code in memory
that was deallocated when the module was unloaded.

It is like acting on the rising edge rather than the falling edge.

But if i can't find anything else (and nobody else comes up with a better
suggestion) I'll do it this way - having the machine hang is a
surprisingly large motivator for taking a less-than-perfect approach
that is quicker :)

-David Waite


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.046 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site