Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Technical Linux questions



On Fri, Feb 21, 2003 at 11:30:27AM -0500, Patrick R. McManus wrote:
> > Probably a stupid question but what's PID space got to do with threads? Each 
> > thread doesn't get it's own PID, does it?
> 
> on linux (currently) each thread does get its own pid. I've always
> found that odd as well.

Linux has a clone() system call, depending upon its parameters one can
get a fork of a completely new process sharing (early?) nothing with
its parent, or one can get a thread sharing a lot with its parent,
with a lot of steps in between.  I think the logic is that if the
kernel is going to have a well written scheduler that is good at
parceling out CPU time, then that scheduler should do the scheduling,
and not have nested scheduling.  I think this might make it possible
for a process to have some threads scheduled as "realtime" (at least
Linux's approximation) but not the whole porcess.  Because the kernel
scheduler handles all threads, all those threads need their own PIDs.

Interesting note: UML (User Mode Linux, run another copy of Linux as a
process on Linux, and more copies of Linux on that Linux if one
pleases, and so forth) also gets the whole cloud of processes running
down on the base Linux.  (I am not sure of the ramifications of Linux
doing this beyond beyond it feeling strange.  There is a specific UML
patch available to make the sub-Linux a single process.)


-kb




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org