Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between a thread's stack and a process's stack

Do threads and processes both have independent stacks? If the answer is yes, what's the difference between them? Thanks in advance!

like image 377
Summer_More_More_Tea Avatar asked Jan 25 '10 11:01

Summer_More_More_Tea


1 Answers

Processes don't have a stack. Threads do. A process is typically an address space, some resources and one or more threads. The threads run the actual code of the process so they each have their own stack.

The wiki article on stacks has more information http://en.wikipedia.org/wiki/Call_stack

like image 52
Brian Rasmussen Avatar answered Nov 15 '22 10:11

Brian Rasmussen