Sunday, June 17, 2012

Process and Thread

An application comprises instructions and data.  Before a program runs, it consists of instruction and initialized data sections on the disk.

A process contains instruction, data and states.  State is a set of value held in the registers, address of current instruction, values held in memory and flags.  State is private to the process itself unless it is explicitly set up to share.  In memory, a process contains the text, initialized data, uninitialized data, heap, stack, library and linrary data.

A thread has some state but basically just the regiesters and the stack.  Each thread has its own stack.

No comments: