Reuben Martin wrote:
Why then are the threads assigned separate PIDs?
This is a byproduct of how threads are implemented in the Linux kernel;
they are just separate processes which share the same address map. The
way Linux does it is simpler that some other OSes which have separate
code to handle threads within a process vs processes themselves.
I was under the assumption
that PID stood for "Process Identifier".
Correct.
(Perhaps "Posix thread IDentifier"
would be a better definition of the acronym) I was totally unaware that you
could assign process threads separate scheduling priorities / policies apart
from the parent process.
I think this is even a requirement for POSIX.
Also, is it possible (within the context of
programming) to assign threads
individual names to give an indication as to what the specific PID is doing,
or are thread PID names always named the same as the parent process?
Not sure.
I'm sure these questions open up a whole can of
worms dealing with the mess of
conforming modern programming concepts to an aging POSIX framework.
What can of worms? What mess?
Quite honestly I think POSIX is showing far less signs of age that many
other far younger APIs (win32 I'm looking at you).
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Java, the best argument for Smalltalk since C++." -- Frank Winkler