Free mock test
Process, Memory and File Management

Process, Memory and File Management

Software and Operating Systems · 2 min read

Process management

A process is a program in execution. A thread is a smaller unit of a process.

StateMeaning
NewProcess is being created.
ReadyWaiting for the CPU.
RunningUsing the CPU.
Waiting (blocked)Waiting for input or output.
TerminatedFinished.

The Process Control Block (PCB) stores a process's information. Switching the CPU from one process to another is a context switch.

CPU scheduling algorithms

AlgorithmRule
FCFSFirst Come First Served. Simple, can cause long waits.
SJFShortest Job First. Lowest average waiting time.
Round RobinEach process gets a fixed time quantum in turn. Used in time-sharing.
PriorityHighest priority first. Low priority may starve.

Worked example (FCFS). Processes P1, P2, P3 arrive together with burst times 5, 3 and 2 ms. Waiting times: P1 = 0, P2 = 5, P3 = 8. Average waiting time = (0 + 5 + 8) รท 3 = 4.33 ms. With SJF (order 2, 3, 5) waits are 0, 2, 5 and the average is 2.33 ms, which is why SJF is optimal.

Deadlock

Processes wait for each other forever. It needs all four conditions: mutual exclusion, hold and wait, no pre-emption, circular wait.

Memory management

TermMeaning
PagingMemory divided into fixed-size blocks: pages (program) and frames (RAM).
SegmentationMemory divided into variable-size logical parts (code, data, stack).
Internal fragmentationWasted space inside an allotted block.
External fragmentationFree space split into pieces too small to use.
Virtual memoryDisk space used as extra RAM, so large programs can run.
ThrashingThe system spends more time swapping pages than working.
Page replacementFIFO, LRU (Least Recently Used), Optimal.

File systems

SystemFacts
FAT32Old. Maximum file size 4 GB. Works on pen drives and all systems.
exFATFor flash drives and large files.
NTFSWindows standard. Large files, security permissions, encryption, compression.
ext4Linux standard.

A file has a name and an extension: .docx, .xlsx, .pptx, .pdf, .txt, .jpg, .png, .mp3, .mp4, .zip, .exe. Files are arranged in folders (directories); the top is the root.

Keep practising

Notes are only half the work. Test yourself with questions and discuss doubts with other aspirants.

Prepared for exam revision from standard computer textbooks, Microsoft documentation and official sources. Features differ between Excel and Word versions (2016, 2019, 2021, 365) so check which version your exam follows. Found a mistake? Tell us.