1/56
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
the operating system works closely with?
processor, processes, and threads
Processor
executes instructions
Thread
performs a sequence of instructions within a process
allows multiple tasks to make progress during overlapping periods
Concurrency
A processor
also known as the Central Processing Unit (CPU), is the hardware component that executes instructions from computer programs.
Why the Processor Is Important
Without a processor, software programs cannot execute instructions. Applications such as browsers, games, operating systems, and office software all depend on processor resources
instruction cycle.
The CPU generally processes instructions through
Fetch
The processor retrieves an instruction from memory.
Decode
The processor determines what the instruction means and what operation must be performed
Execute
The processor performs the required operation.
Store
The result is stored in a register or memory.
Arithmetic Logic Unit
performs arithmetic and logical operations
Control Unit (CU)
coordinates the activities of the processor
Registers
are very small and very fast storage locations inside the processor
Program Counter (PC)
Contains the address of the next instruction.
Instruction Register (IR)
Contains the instruction currently being processed.
General-Purpose Registers
Store temporary data used during computation
Registers
are faster than ordinary RAM because they are located directly within the processor
Cache memory
is high-speed memory used to store frequently accessed data and instructions.
Common cache levels include
L1 Cache
⦠Very fast
⦠Small capacity
⦠Closest to the CPU core
L2 Cache
⦠Larger than L1
⦠Slightly slower
L3 Cache
⦠Larger than L1 and L2
⦠Often shared among CPU
If frequently used information is already in cache, the CPU can access it faster instead of retrieving it from slower main memory.
Cache Is Important
CPU core
is an individual processing unit within a processor
Clock speed
indicates how quickly a processor's clock operates.
quad-core
processor has four processing cores
This allows multiple threads to potentially execute simultaneously.
More CPU cores
Having BLANK does not automatically make every program faster. The software must be designed to take advantage of multiple cores.
⦠MHz ā megahertz
⦠GHz ā gigahertz
Clock speed is commonly measured in:
process
is a program that is currently executing
Process Control Block (PCB).
The operating system maintains information about processes through a structure commonly
When the operating system switches between processes, it needs to save and restore information about each process. The PCB helps the operating system manage this information
Why PCB Is Important
New
The process is being created.
Ready
The process is waiting for CPU time.
Running
The process is currently being executed by the CPU.
Waiting/Blocked
The process is waiting for an event or resource.
Terminated
The process has finished execution.
Basic Flow
New
ā
Ready
ā
Running
ā
Terminated
thread
is the smallest unit of execution that can be scheduled by an operating system
Why Threads Are Used
allow an application to perform different activities without requiring a separate process for every activity
single-threaded process
has one thread of execution.
multithreaded process
contains multiple threads.
Responsiveness
The application can continue responding while another thread performs a background task.
Resource Sharing
Threads within the same process can share memory and resources.
Economy
Creating threads generally requires fewer resources than creating separate processes.
Scalability
Multithreaded applications can take advantage of multiple CPU cores.
Complexity
Programs become more difficult to design and debug.
Deadlocks
Threads may become permanently blocked.
Race Conditions
Threads may interfere with shared data.
Synchronization Overhead
Locks and other synchronization mechanisms can reduce performance if used excessively.
User-level threads
are managed by a user-level thread library or runtime environment
Advantages of User-level threads
⦠Fast thread management
⦠Lower overhead
⦠Flexible implementation
disadvantages of User-level threads
⦠Limited kernel awareness
⦠Blocking behavior can be problematic in some models
⦠Parallel execution depends on the underlying threading model
Kernel-level threads
are managed directly by the operating system kernel.
The operating system can schedule individual threads.
Advantages Kernel-Level Threads
⦠Better support for multicore systems
⦠Individual threads can be scheduled
⦠A blocked thread does not necessarily block other threads
Disadvantages Kernel-level threads
⦠More operating-system overhead
⦠Thread management can be more expensive
Concurrency
to manage multiple tasks during overlapping periods of time.
Concurrency does not necessarily mean that tasks execute at exactly the same moment
Parallelism
means executing multiple tasks at the same time using multiple processing resources.