Types of Operating System and Thread
Types of Operating System and Thread
OPERATING
SYSTEM AND
THREAD
Types of Operating Systems
Characteristics:
Jobs are processed sequentially in batches.
Suited for tasks that don’t require user input.
Often used in older mainframe systems.
Characteristic:
CPU Scheduling: Since there are multiple
programs, the operating system must decide
which one to execute next
Memory Management: Since multiple
programs reside in memory at once, the OS
must efficiently allocate and manage memory
Context Switching: When the CPU switches
from executing one program to another, it
must save the current state of the process
(context) and load the context of the next
program. This process allows the CPU to
return to the interrupted program later.
Example: UNIX, Linux, Windows (to some extent)
Multiprogramming
Multi-Processing System
Multiprocessing Operating Systems are systems that support the use of more than one central
processing unit (CPU) simultaneously. This allows the system to execute multiple processes in
parallel, significantly increasing computing power and performance.
Key features:
Parallel Execution: Multiple processes or threads are
executed in parallel across different CPUs or cores.
Increased Throughput: Multiprocessing improves system
throughput, as more tasks are completed in a given
amount of time compared to single-processing systems.
Reliability: If one CPU fails, the system can often continue
running with the other CPUs, improving reliability and
fault tolerance.
Example
Linux: Supports both symmetric and asymmetric
multiprocessing.
Windows: Modern versions of Windows support
multiprocessing, used in workstations and servers.
macOS: Apple's operating system for Mac computers
supports multiprocessing with multicore processors.
UNIX: Many UNIX-based systems, such as AIX, Solaris, and
HP-UX, support multiprocessing.
Multi-Tasking Operating
System
A Multitasking Operating System is an operating system that allows multiple tasks or
processes to run simultaneously on a single CPU. It manages the execution of various
processes by allocating CPU time in such a way that each task appears to run
independently and concurrently.
Types of Multitasking:
1. Preemptive Multitasking
2. Cooperative Multitasking
Key features:
Context Switching: The OS uses context
switching to rapidly switch between
different processes. It saves the state of the
current process and loads the state of the
next process.
Efficient Resource Use: Multitasking
ensures that system resources such as CPU,
memory, and I/O devices are used
efficiently, reducing idle time for hardware
components.
Time-Sharing
Operating System
A Time-Sharing Operating System allows multiple users or tasks to share system resources,
especially the CPU, simultaneously. It divides the CPU time into small intervals called time
slices and allocates each slice to a different task or user.
Key feature:
Fair Resource Allocation: Time-sharing systems
aim to allocate resources (like CPU time, memory)
fairly among all active users or tasks, preventing
any single task or user from monopolizing the
system.
Response Time: Since time-sharing systems are
designed for interactive use, they aim to provide
fast response times to users’ commands. If a task
doesn't complete within a given time slice, it will
resume in its next allocated slice.
Real-Time Operating
System
A Real-Time Operating System (RTOS) is designed to process data and execute tasks within
a strict time constraint. In a real-time system, responses to inputs or events must occur
within a guaranteed timeframe, known as the "real-time deadline."
Key feature:
Priority-Based Scheduling: Tasks are usually assigned priorities based on their urgency. High-
priority tasks preempt lower-priority tasks, ensuring that the most critical operations get
processed first.
Minimal Latency: The time between the occurrence of an event and the system's response
(latency) is minimized to ensure timely execution of tasks.
Multitasking: RTOS supports multitasking, where several tasks can run concurrently. It manages
the order and execution of tasks based on priority and time constraints.
Real-Time Clock (RTC): RTOS uses a real-time clock to track deadlines and schedule tasks
accordingly. This allows it to measure the passage of time and ensure that tasks are completed
within the required intervals.
Threads
Threads are also called lightweight processes as they possess some of the
properties of processes. Each thread belongs to exactly one process. In an
operating system that supports multithreading, the process can consist of
many threads. But threads can be effective only if the CPU is more than 1
otherwise two threads have to context switch for that single CPU.