Aryan PrajapatKnowledge Contributor
What are the differences between process and thread?
What are the differences between process and thread?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
Aptitude
Engineering Mathematics
Discrete Mathematics
Operating System
DBMS
Computer Networks
Digital Logic and Design
C Programming
Data Structures
Algorithms
Theory of Computation
Compiler Design
Computer Org and Architecture
â–²
Open In App
Operating System Interview Questions
Last Updated : 20 Sep, 2024
An operating system acts as a GUI between the user and the computer system. In other words, an OS acts as an intermediary between the user and the computer hardware, managing resources such as memory, processing power, and input/output operations. Here some examples of popular operating systems include Windows, MacOS, Linux, Android etc.
In this article, we provide you with the top 100+ OS interview questions with answers that cover everything from the basics of OS architecture to advanced operating systems concepts such as file systems, scheduling algorithms, and multithreading. Whether you are a fresher or an experienced IT professional, this article gives you all the confidence you need to ace your next OS interview.
Table of Content
Basics OS Interview Questions
Intermediate OS Interview Questions
Advanced OS Interview Questions
Basics OS Interview Questions
1. What is a process and process table?
A process is an instance of a program in execution. For example, a Web Browser is a process, and a shell (or command prompt) is a process. The operating system is responsible for managing all the processes that are running on a computer and allocates each process a certain amount of time to use the processor. In addition, the operating system also allocates various other resources that processes will need, such as computer memory or disks. To keep track of the state of all the processes, the operating system maintains a table known as the process table. Inside this table, every process is listed along with the resources the process is using and the current state of the process.
2. What are the different states of the process?
Processes can be in one of three states: running, ready, or waiting. The running state means that the process has all the resources it needs for execution and it has been given permission by the operating system to use the processor. Only one process can be in the running state at any given time. The remaining processes are either in a waiting state (i.e., waiting for some external event to occur such as user input or disk access) or a ready state (i.e., waiting for permission to use the processor). In a real operating system, the waiting and ready states are implemented as queues that hold the processes in these states.
For more details you can refer States of a Process in Operating Systems published article.
3. What is a Thread?
A thread is a single sequence stream within a process. Because threads have some of the properties of processes, they are sometimes called lightweight processes. Threads are a popular way to improve the application through parallelism. For example, in a browser, multiple tabs can be different threads. MS Word uses multiple threads, one thread to format the text, another thread to process inputs, etc.
4. What are the differences between process and thread?
Process is program under action and thread is the smallest segment of instructions (segment of a process) that can be handled independently by a scheduler.
Threads are lightweight processes that share the same address space including the code section, data section and operating system resources such as the open files and signals. However, each thread has its own program counter (PC), register set and stack space allowing them to the execute independently within the same process context. Unlike processes, threads are not fully independent entities and can communicate and synchronize more efficiently making them suitable for the concurrent and parallel execution in the multi-threaded environment.