Re: Thread Questions

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Wed Aug 23 2000 - 15:30:40 EST


> The first is that we need a way to determine whether a given process ID is
> a light weight process (i.e. a thread of an existing process) or a
> process. Basically, we need to be able to extract the total memory and

We dont distinguish. Everything is a thread and has degrees of sharing.

> thread as a separate process. Currently, working through /proc, we are
> seeing each thread as a separate process and are thus claiming that
> applications are using far more memory than they actually are.

You may be able to figure out who is sharing a memory object via /proc
however any given memory share could be via mmap

> Secondly, we are looking for some way to tie signal handling to a
> particular thread. In our application, it is really preferable that all
> signals be handled in the main thread (which is the web server). Is there
> any way to force all signals to be received in the main thread?

Just kill that thread. At least as far as the kernel is concerned. The delusion
you cant kill specific threads is pthreads emulation in glibc not the kernel.
You need to figure how to go around the back of glibc I suspect

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



This archive was generated by hypermail 2b29 : Wed Aug 23 2000 - 21:00:10 EST