0% found this document useful (0 votes)
10 views4 pages

Understanding Processes and Threads in OS

The document provides an overview of key concepts in operating systems, including processes, threads, virtual memory, and CPU scheduling. It explains the life cycle of processes, the benefits of multithreading, and issues like thrashing and deadlock. Additionally, it covers memory management techniques, inter-process communication, and the roles of various system components.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views4 pages

Understanding Processes and Threads in OS

The document provides an overview of key concepts in operating systems, including processes, threads, virtual memory, and CPU scheduling. It explains the life cycle of processes, the benefits of multithreading, and issues like thrashing and deadlock. Additionally, it covers memory management techniques, inter-process communication, and the roles of various system components.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

[Link] is a process, and what is a process table?

A process is a program that is currently running, with its own data, resources, and state.
The process table is a data structure used by the operating system to store information about all
processes.
It keeps details like process ID, state, memory usage, and CPU registers so the OS can manage them
efficiently.

2. What are the different states of a process?

A process moves through different states during its life cycle.


It starts in the New state, then becomes Ready while waiting for CPU time, Running when it’s
executing, and may go to Waiting if it’s waiting for input or output.
Finally, it reaches the Terminated state after finishing execution.

[Link] is a thread?

A thread is the smallest unit of execution within a process.


Multiple threads can run in the same process and share memory and resources, but each thread has
its own execution path.
Using threads helps in performing multiple tasks faster without consuming extra memory.

4. What are the differences between a process and a thread?

A process is an independent program in execution with its own memory space, while a thread is the
smallest unit of execution within a process.
Threads share memory and resources with other threads of the same process, making them lighter
and faster.
Processes are more isolated, while threads are more cooperative but also more dependent.

5. What are the benefits of multithreaded programming?

Multithreaded programming allows multiple parts of a program to run at the same time.
This improves CPU utilization, makes programs faster, and keeps applications responsive.
Threads share memory, so they use fewer resources, and creating them is cheaper than creating
separate processes.

6. What is thrashing?

Thrashing happens when the operating system spends more time moving data between RAM and
the disk than actually running programs.
This usually happens when there are too many processes for the available memory, causing very slow
performance.

7. What is virtual memory?

Virtual memory is when the operating system uses part of the hard disk as extra RAM.
It allows programs to run even if the physical memory is small by swapping data between RAM and
disk.
This helps in running large applications and keeps processes separate for security.

8. What is a kernel?
The kernel is the core part of an operating system that manages hardware and software
communication.
It handles tasks like process management, memory allocation, and device control.
Without the kernel, applications wouldn’t be able to use the computer’s hardware.

9. What are the different CPU scheduling algorithms?

CPU scheduling algorithms decide the order in which processes get CPU time.
Examples include FCFS, SJF, Priority Scheduling, Round Robin, and Multilevel Queue.
Each has its own strengths — some are fair, some are fast, and some are designed for specific system
needs.

10. What is demand paging?

Demand paging is when the operating system loads a page into memory only when it’s actually
needed, instead of loading the whole program at once.
This saves RAM and lets us run bigger programs, but too many page faults can slow things down.

[Link] is fragmentation?

Fragmentation is when memory is wasted because of how it’s divided and allocated.
Internal fragmentation is wasted space inside allocated blocks, while external fragmentation is when
free memory is scattered into pieces too small to use.

[Link] is paging, and what’s its basic function?

Paging is a way of managing memory where programs are divided into equal-sized pages and stored
in memory frames of the same size.
It avoids external fragmentation, allows pages to be stored anywhere, and helps in implementing
virtual memory.

[Link] is context switching?

Context switching is when the CPU changes from one process to another.
The operating system saves the current process’s state and loads the next one’s state so both can
continue without losing progress.
It’s what makes multitasking possible.

[Link] is deadlock, and what are the necessary conditions that cause it?

Deadlock is when processes are stuck waiting for each other’s resources, and none can continue.
It happens if four things occur together: mutual exclusion, hold and wait, no preemption, and circular
wait.

[Link] is the Banker’s algorithm?

The Banker’s Algorithm is used to avoid deadlock by checking if granting resources will keep the
system in a safe state.
It’s like a banker who ensures that giving a loan won’t stop other customers from getting their loans.

[Link] are logical vs. physical address differences?

A logical address is generated by the CPU and is what a program uses.


A physical address is the actual location in RAM.
The Memory Management Unit translates logical addresses into physical ones so the program can
access real memory.

[Link] is a file system, and what are common file operations?

A file system is how the OS stores and manages files on a disk.


It organizes data, keeps track of file locations, and supports operations like creating, reading, writing,
deleting, and renaming files.

[Link] is thrashing, and how can it be prevented?

Thrashing is when the CPU spends more time swapping pages than running programs, causing the
system to slow down.
It can be prevented by reducing the number of processes, adding more memory, and using better
page replacement strategies.

[Link] is mutex, semaphore, and what are their drawbacks?

A mutex is a lock for mutual exclusion — only one process can use the resource at a time.
A semaphore is a signaling mechanism that can allow one or more processes to access resources.
Their drawbacks include the risk of deadlocks, debugging difficulty, and performance overhead.

[Link] are orphan, zombie, and starvation?

An orphan process is a child left running after its parent has ended.
A zombie process is one that has finished but is still in the process table because its parent hasn’t
cleaned it up.
Starvation is when a process never gets CPU or resources due to other higher-priority processes
taking over.

[Link] is a dispatcher, and what does dispatch latency mean?

The dispatcher is part of the OS that hands over CPU control to the process selected by the
scheduler.
Dispatch latency is the time it takes to switch from one process to another, including saving and
loading process states.

[Link] is virtual memory (briefly)?

Virtual memory lets the OS use hard disk space as extra RAM so large programs can run smoothly
even with limited physical memory. It works by swapping data between RAM and disk.

[Link] is multiprogramming vs. multitasking?

Multiprogramming keeps several programs in memory so the CPU is always busy by switching when
one waits for I/O.
Multitasking is about switching tasks so fast that it seems they run simultaneously, improving user
responsiveness.

[Link] is spooling?
Spooling is when the OS temporarily stores data in a buffer before sending it to a device like a printer.
It lets the CPU continue working while the device processes jobs at its own speed.

25. What is IPC (Inter-Process Communication), and what are its types?

IPC is how processes communicate and share data. Common types are shared memory, message
passing, pipes, sockets, and signals. Shared memory is faster but needs synchronization, while
message passing is simpler and safer.

You might also like