New threads and processes are both created via a call to clone(). The former
uses flags that tell clone not to duplicate everything (like virtual
memory). The new thread or process gets a unique PID. In the 2.6 there'll be
something called a process group ID and a new threading model known as NPTL.
All threads created by a process will belong to such a group. The display of
processes can then be restricted to much less numbers of beasts. (Mind you
the practice of creating hundreds or even thousands of threads by many
(typical?) Java apps. is pretty braindead. The use of a few threads with
work queues seems (to me) to be a better practice.)

-----Original Message-----
On Tue, 2003-07-29 at 15:37, Ann Smith wrote:
> We recently moved a java app and some MQ clients and servers to
> linux/390 for testing. Folks here are used to Solaris and are confused
> by the number of processes that show up when you issue 'ps -ef'. Many
> more than they are used to. If you ask Jeeves, there is info on the
> threading model linux uses. Linux apparently doesn't have 'lightweight'
> processes. Every thread is a process? I looked for an option on 'ps' to
> try to make the display look more like Solaris but didn't see one. Does
> anyone know of a good source of documentation on linux threading and
> processes?

ps will definitely show each thread.  Threads are lighter weight than
normal processes but still shown as processes by ps; there's some reason
in the kernel that this is the case.  I don't remember enough about this
to be more helpful, though, and I don't know if there's a way to make ps
be more selective.

Reply via email to