Memory Layout of Thread

Each process has four sections that is:

Similarly, even thread has these sections but text, Data and, Heap sections are common to all the threads but only the stack section is separate for each thread.

A multithreaded aware operating system also needs to keep track of threads. The items that the operating system must store that are unique to each thread are:

The items that are shared among threads within a process are:

  • Text segment (instructions)
  • Data segment (static and global data)
  • BSS segment (uninitialized data)
  • Open file descriptors
  • Signals
  • Current working directory
  • User and group IDs

Diag-1: Memory Layout with two Threads

Single threaded vs Multithreaded Process

Relevant Posts:



Categories: Operating system (OS)

3 replies

Trackbacks

  1. Index of Operating System - Tech Access
  2. Characteristics of a Thread - Tech Access
  3. Pros and Cons of Thread - Tech Access

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: