2008/3/4, Vijay Chauhan <[EMAIL PROTECTED]>:
>
> Hi,
>
> In Linux_Kernel_Development book it is mentioned that:
>
> A process consists of one or more threads of execution.
> Each thread includes a unique program counter, process stack, and set of
> processor registers.
> So all the threads of a process share the same stack??
>

No. Each thread has  a uniuque stack (as your statement already says).
Anyway, they share the same address space, meaning that all the threads
spawned by a particular process will _see_ the same address space (the
parent's address space). On Linux, a thread is a process indeed: for the
scheduler there is no difference at all. Although threads maintains its own
state, stack, registers, and program counter, the signal handlers, open file
descriptors, and pending alarms are shared among  the parent process and its
threads.


Mauad

Reply via email to