Operatin System Assign

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

University Of Technology Nowshera

Name : Muhammad Ibrar

Reg No :NSR/21/IT/09

Assinment No:01

Q1.What is different between process and threads explai different types of threads?

Process
A process is an active program, i.e., a program that is under execution. It is more than the program
code, as it includes the program counter, process stack, registers, program code etc. Compared to this,
the program code is only the text section.
When a computer program is triggered to execute, it does not run directly, but it first determines the
steps required for execution of the program, and following these steps of execution is referred to as a
process. An individual process takes its own memory space and does not share this space with other
processes.
Processes can be classified into two types namely – clone process and parent process. A clone
process, also called a child process, is one which is created by another process, while the main
process is one that is responsible for creating other processes to perform multiple tasks at a time is
called as parent process.
.
Thread
A thread is a lightweight process that can be managed independently by a scheduler. It improves the
application performance using parallelism. A thread shares information like data segment, code
segment, files etc. with its peer threads while it contains its own registers, stack, counter etc.
A thread is basically a subpart of a large process. In a process, all the threads within it are interrelated
to each other. A typical thread contains some information like data segment, code segment, etc. This
information is being shared to their peer threads during execution.
The most important feature of threads is that they share memory, data, resources, etc. with their peer
threads within a process to which they belong. Also, all the threads within a process are required to be
synchronized to avoid unexpected results.

Types of Threads
In the  there are two types of threads.
1. Kernel level thread.
2. User-level thread.

Kernel level thread

The kernel thread recognizes the operating system. There is a thread control block and process control
block in the system for each thread and process in the kernel-level thread. The kernel-level thread is
implemented by the operating system. The kernel knows about all the threads and manages them. The
kernel-level thread offers a system call to create and manage the threads from user-space. The
implementation of kernel threads is more difficult than the user thread. Context switch time is longer
in the kernel thread. If a kernel thread performs a blocking operation, the Banky thread execution can
continue. Example: Window Solaris.
User-level thread

The operating system does not recognize the user-level thread. User threads can be easily
implemented and it is implemented by the user. If a user performs a user-level thread blocking
operation, the whole process is blocked. The kernel level thread does not know nothing about the user
level thread. The kernel-level thread manages user-level threads as if they are single-threaded
processes?examples: Java thread, POSIX threads, etc.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy