lkml.org 
[lkml]   [1999]   [Jun]   [21]   [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, Pavel Machek wrote:

> > The problem is that the drivers have threads running that are not dying
> > before I start deallocating resources.
>
> Hmm, you might do something like
> while (sys_kill(pid, SIGTERM) != -1)
> schedule();
...
> Wait. In what context process does cleanup_module() code run? It is
> probably not safe to do blocking call in idle task or something
> similary bad.

Blocking in cleanup_module is okay; it's run in the context of whatever
process is calling the delete_module system call (eg. rmmod). The real
problem is being sure that cleanup_module does not return until the thread
associated with that module is truly gone. waitpid should really be the
right solution (opposed to the semaphore method I suggested, which was
really not very good), but I'm not sure why it wasn't consistently working.

-bp
--
# bryan at terran dot org
# http://www.terran.org/~bryan


-
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.579 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site