Re: kernel thread support - LWP's

cd_smith@ou.edu
Fri, 16 Jul 1999 02:32:07 -0500 (CDT)


On Fri, 16 Jul 1999, Richard Gooch wrote:
> > > I once wanted to selectively stop some threads
> > > in nfsd on Solaris, and I couldn't do that easily. I had to root
> > > around in /proc to target the individual threads. Yuk. What I wanted
> > > to do was:
> > > # kill -STOP pid
> >
> > The downside to this is that threads must defensively assume you
> > _might_ kill individual ones. Presumably in the Solaris model, they
> > can be written to be codependent? I'm thinking of things like
> > mutexes and so on.
>
> In this case, I didn't want the application to know what I was up
> to. I *wanted* to violate it, without it being able to work around me.

Okay, but that is a somewhat strange goal. It would be possible even if I
did everything I currently want to do (including making CLONE_PID work,
etc). It would require that you grab a thread ID from the /proc tree,
unless your psutils package were to support threads and tell you thread
ID's. These things, IMHO, aren't nearly as ugly as the stuff that results
from NOT separating threads and processes, like long lists of "processes"
doing the same thing.

You wanted to do something really weird like kill a specific thread in
another process. That's a really dangerous thing to do (what if it had a
mutex at the time?) and certainly not normal, any more than writing to the
memory of a different process is normal. So you had to look at something
more low-level to do it. Makes sense to me.

Chris Smith <cd_smith@ou.edu>

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