Sonzaschool
Rudi

Sekondari ya Juu · Kidato cha Tano

Sayansi ya Kompyuta

Demonstrate competency in recognising and using operating system design and performance [Process Management (Processes and threads, process creation, synchronisation and Communication), CPU/Processor Scheduling (Deadlock prevention, avoidance and recovery), Memory Management (Main and virtual memory management), File System Structure and implementation, Input/output Systems and device management]

takriban dakika 7 kusoma

Mada za sehemu hiiDemonstrate understanding of principles of Operating Systems [Types of OS; Memory management; File management; CPU Scheduling; etc]Mada 3
  1. Describe the concept of operating systems (evolution, types, architecture, structure and design)
  2. Describe the impact of operating system design on application system design and performance
  3. Demonstrate competency in recognising and using operating system design and performance [Process Management (Processes and threads, process creation, synchronisation and Communication), CPU/Processor Scheduling (Deadlock prevention, avoidance and recovery), Memory Management (Main and virtual memory management), File System Structure and implementation, Input/output Systems and device management]

Operating system design directly determines how efficiently a computer uses its hardware resources—CPU time, memory, storage, and peripheral devices. Understanding OS design and performance helps you troubleshoot slow computers, manage multiple programs, and appreciate how applications run smoothly on your device.

Process state diagram: New, Ready, Running, Waiting and Terminated with labelled transitions

Processes and Threads

A process is a program in execution. When you open any application—such as a web browser or music player—the operating system creates a process that requires resources like memory and CPU time. The OS acts as a "headmaster" managing these processes to ensure smooth operation.

A thread is a smaller unit within a process that shares the process's resources (memory and CPU time). Multiple threads within one process can run concurrently, enabling efficient multitasking. For example, when you use a web browser:

  • One thread downloads content from the internet
  • Another thread displays the page on screen
  • A third thread handles your mouse clicks and keyboard input

This allows you to browse while the page loads without the browser freezing.

Process Creation

When you launch software, the OS performs these steps:

  1. Creates a new process — allocates a unique Process ID (PID)
  2. Allocates memory — assigns RAM space for the program's code and data
  3. Sets up the execution context — loads the program into memory and prepares CPU registers
  4. Adds to the scheduling queue — makes the process ready to run on the CPU

Multiple processes compete for CPU time, so the OS uses scheduling algorithms to manage the queue and ensure smooth multitasking.

Process Synchronisation and Communication

When multiple processes share resources (like a file or printer), they must coordinate access to avoid conflicts. The OS provides mechanisms for this:

  • Semaphores: Special flags that signal whether a resource is available. A process checks the semaphore before using a shared resource and updates it to "in use" to prevent others from accessing it simultaneously.
  • Critical sections: The part of program code where a shared resource is accessed. The OS ensures only one process can be in its critical section using a particular resource at a time.

Worked Example: Imagine two students sharing one printer at school. Student A sends a document to print (Process 1), and Student B tries to print at the same time (Process 2). Without synchronisation, both documents might mix together. The OS uses a semaphore to let only one process use the printer at a time—Student A's job prints first, then the semaphore signals "available" for Student B.

Swali

What is a thread in the context of operating systems?

Ingia ili kuwasilisha jibu lako na lihesabiwe katika umahiri wako.

Ingia ili kufanya mazoezi

Mwalimu

Umekwama? Niulize chochote kuhusu mada hii.

Ingia ili kumuuliza Mwalimu wa AI wa Sonza kuhusu swali hili.

Ingia ili kuuliza