So, if threads share the same address space, does it mean that they
share the code and data segment and their stacks are in the same
address space just locate at different linear address?

On Tue, Mar 4, 2008 at 10:28 PM, Mauricio Mauad Menegaz Filho
<[EMAIL PROTECTED]> wrote:
>
>
> 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
>
>



-- 
Wu Yu

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to