Re: process / thread stack

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

 





2008/3/4, Vijay Chauhan <kernel.vijay@xxxxxxxxx>:
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


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux