Re: how does kernel manages stack for threads?

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

 



On Wed, 2009-09-23 at 23:28 -0400, CP YEH wrote:
Hi,

I am just wondering how the kernel manages user space stack for
different threads.

I tried to follow the code and noticed that if CLONE_VM is specified,
the kernel simply points mm to parent's mm. I suppose pthread does
specify CLONE_VM so this true for pthread.


In this case, both parent and thread points to the same mm and
especially same stack and I just can't quite understand how this is
possible.
Could anyone give me some insight on this?

Threads are created along side with other flags like - CLONE_VM CLONE_FS CLONE_FILES CLONE_SIGHAND for sharing the resources belonging to the same address space. Though each thread has its own stack within the process address space, the stack is also shared among the other threads. So one threads stack could be readable be the other threads.

Thank you very much in advance.

YEH

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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