Structure of CPU scheduling algorithm and each algorithm
·
Computer Science/Operating System
CPU SchedulerThe CPU scheduler assigns CPU time to threads (units of work) from processes according to a scheduling algorithm.These algorithms aim to:Maximize CPU utilizationMaximize the amount of work done in a given timeMinimize the number of processes in the ready queueMinimize response time Non-Preemptive SchedulingIn non-preemptive scheduling, a process voluntarily releases the CPU;the OS d..
Shared resources, Critical sections, and Deadlock
·
Computer Science/Operating System
Shared ResourceA shared resource refers to resources or variables within a system that multiple processes or threads can access concurrently — such as monitors, printers, memory, files, or data.When two or more processes attempt to read or write to a shared resource simultaneously,this situation is called a race condition — where the timing or order of access affects the outcome.Critical Section..
Threads and Multithreading
·
Computer Science/Operating System
What is a Thread?A thread is the smallest unit of execution within a process.A single process can have multiple threads.Unlike processes, which each have their own code, data, and heap,threads share the code, data, and heap of their process. → This allows multiple tasks to run concurrently within a single process.MultithreadingMultithreading is a technique where multiple threads within a process..
PCB & Context Switching
·
Computer Science/Operating System
PCB (Process Control Block)The Process Control Block (PCB) is a data structure used by the operating system to store *metadata about a process.It is created by the OS when a process is generated.The PCB contains all the essential information needed to manage and control the process.Since it holds critical information, it is protected and maintained at the front of the kernel stack, inaccessible ..
Process
·
Computer Science/Operating System
A process is a program that is currently being executed on a computer.It is almost the same as a task, which is the unit of work scheduled by the CPU.When a program is loaded into memory, it becomes an instance of a process,and then the CPU executes it according to the operating system's scheduler. Memory Structure of a ProcessWhen the OS allocates memory to a process, it follows this structure:..
How memory manages data
·
Computer Science/Operating System
One of the key roles of an operating system is memory management.It must maximize the use of limited memory resources inside the computer.Virtual MemoryVirtual memory is a memory management technique thatabstracts the actual physical memory resources available on a computerand makes it appear as a very large memory to the users. The virtual addresses given are called virtual addresses (logical ..