New Page 1
Welcome to basicsofcomputer.com
 

Share This Free Knowledge With Your Friends:

Home » Threads and CPU Scheduling » Introduction to threads/Lightweight Process

Introduction to threads/Lightweight Process:

A thread is a basic unit of CPU utilization. It is also called a lightweight process. A thread is a sequence of instructions within a process. A thread behaves like "a process within a process" but it differs from a process in that a thread does not have its own PCB. Usually multiple threads are created within a process Threads are different kind of program executing within process. Processes are programs in execution within kernel.

Thread consists of the following:

  • ThreadID
     
  • Program Counter
     
  • Register Set
     
  • Stack

A thread shares some things with its peer threads (all the other threads in this particular task). The things that it shares are:

  • Code Section
     
  • Data Section
     
  • Any operating system resources, which are available to the task

A traditional heavyweight process is the same as a task with one thread. The term thread really refers to thread of execution. A multi-threaded process means that more, than one part of the same process may be running at one time.

In a multi-threaded task, one server thread may be blocked and waiting for something and another thread in the same task may be running. If a heavyweight process blocks then the whole process stops. Multithreading is useful in programs such as web browsers where you may wish to download a file, view an animation and print something at the same time.

When multiple threads cooperate in a single job, there is a higher throughput. If one thread must wait, the whole process does not stop. Another thread may still run. Applications that require sharing a common buffer (such as the producer consumer problem) may benefit from using threads.

Types of Threads:

Threads may be handled at different levels.

1. Kernel-Level Threads:

Kernel-supported threads are seen by the operating system and must be scheduled by the operating system. One multithreaded process may have multiple kernel threads.

2. User-Level Threads:

User-level threads are not seen by the operating system and are also very fast. Switching from one thread to another in .a single process does not require a context switch since the same process is still executing. However, if the thread that is currently executing blocks, the rest of the process may also be blocked if the operating system sees only one kernel thread for this process. The thread that the kernel sees is the same as the blocked thread, hence the kernel assumes that the whole process is blocked.

Relevant Articles:

Introduction to threads/Lightweight Process
Advantages of Multithreading
Multithreading Models in Operating System
Definition and Explanation of CPU Scheduling in Operating system
Definition and Explanation of Multiprogramming in Operating system
Scheduling Objectives in Process
CPU I/O Burst Cycle
CPU Scheduler in operating systems
Preemptive and Non-Preemptive Scheduling
Interval Timer
Dispatcher in Operating System
Scheduling Criteria in Operating System
Scheduling Algorithms in Operating System
Multiple Processor Scheduling in Operating System
Real-Time Scheduling in Operating System
Algorithm Evaluation in Operating System
 
New Page 1

Basic Computer Science

   
» The Age of Information

» Types of Computer and Digital Age

» Input and Output Devices

» Storage Devices Of Computer

» Central Processing Unit

» Software: The Power Behind The Power

» Data Communication and Computer Networks

» The Nature Of Information

» The System Theory

» Transaction Processing System (TPS) and Management Information System (MIS)

» Decision Support System (DSS) and Executive Support System (ESS)

» Expert System (ES) and Office Information System (OIS)

 

Operating Systems

   
» Introduction to Operating System

» Introduction to Process Management

» Threads and CPU Scheduling

» Process Synchronization in Operating System

» Deadlocks

» Memory Management in Operating System

» Virtual Memory in Operating System

» File System Management in Operating System

» I/O and Device Management

» Security

» Linux Operating System

 

Database Management System

   
» Introduction to Database Systems

» Database System Architecture

» Database Administration and Database Development Process

» The Entity-Relationship Model

» Semantic Object Model

» Logical Database Design and Relational Data Model

» Normalization in Database

» Transformation of E-R Model into Relational Data Model

» Representing Semantic Object Model and Types of Semantic Object Model

» Physical Database Design

» Introduction to Structured Query Language (SQL)

» Implementation of Relational Database and Database Application Design

» Client Server Database Systems & Open Database Connectivity (ODBC)

 

Questions and Answers

   
» Basics of Information Technology

» Computer Architecture

» Data Communication

» Information Networks

» Fundamentals of the Internet

» Application and Uses of Computer

» Security, Copyright and The Law

» Windows Operating Systems

» Spreadsheet Software

» Process Management in CPU

» CPU Scheduling

» Process Synchronization

» Deadlocks

» Memory Management

» Database Systems

» Database System Architecture

» Database Administration and Database Development Process
 
 
New Page 1
 

Home                Dictionary                 Contact us                   About us                    Privacy policy                  Link to us                   Advertise

Copy right ©  2012