Multiprocessing Flashcards
What is a single-core processor ?
- Has only one CPU
- Can only execute one task at a time
- reduce heat and power consumption compared to multicore processor
- as clock speed increases, power consumption + heat generation becomes a challenge
What is a multicore processor ?
- Two or more independent cores (CPUs) in a single chip
- Each core can execute it’s own thread or tasks independently
- Has parallelism, where multiple cores allow simultaneous execution of multiple threads, improving performance for multi-tasking
- Terms of energy efficient, multi core achieves better performance per watt compared to single core that runs at higher frequency
Single vs Multiple Core
PROCESSING UNITS –> ONE CORE | TWO OR MORE COES
PERFORMANCE –> Handle one task at a time | Can handle multiple tasks simultaneously
POWER EFFICENCY –> Less efficient as clock speed increases | More efficient because has multiple cores and runs at lower clock speed
HEAT GENERATION –> Produces less heat | Produces more heat
Multitasking –> Time-sharing mechanisms | True Parallel execution
What are the 3 types of multiprocessing architecture
- Symmetric Multiprocessing
- Asymmetric Multiprocessing
- Distributed MultiProcessing
What is symmetric processor (SMP)
- All processors share a single memory and are treated equally
- Any processors can perform any tasks and have equal access to memory and I/O devices
- Processors share the same memory space and OS (operating system)
Challenges in SMP
- Memory bottleneck: As processors share same memory, there can be contention when multiple cores access the same data
- Cache coherence: Ensuring all cores have the most up-to-date data can be challenging
- Scalability Issues: Adding too many cores reduces performance due to overhead in communication
Solutions in SMP
Use multi-level cache (L1, L2,L3) to reduce memory access delay
Use cache coherence protocol such as MESI (Modified, Exclusive, Shared, Invalid)
Use hyper-threading and optimize software
What is Asymmetric Processor (AMP)
One processor acts as the “Master” controlling the system and assigning tasks to “slave” processors
Processors are not equal in functionality or capability
Processors may run different operating system or perform specialized tasks
Only master processor has full access to system resources
Challenges in AMP
- Single point of failure: If master processor fails, entire system stops functioning
- Load imbalance: The master processor can become bottleneck if it fails to assign tasks efficiently
- Less flexible as slave processors are limited in their role
Solutions in AMP
- Have a backup master processor and ready to overtake if needed
- Use dynamic scheduling algorithm to balance workload
- Use hardware-based task schedulers to offload scheduling tasks from the master processor
-
Distributed Multiprocessing
- Processors communicate each other via message passing
- Processors do not share the same memory, each has own local memory
- Communication happens through interconnection networks (E.x.: Ethernet)
Disadvantages in Distributed Multiprocessing
Requires Complex programming
Communication latency becomes bottleneck
What is load balancing
- Efficient distribution of tasks of workloads across multiple processors
- To maximize performance and minimize bottlenecks
- Ensures all processors are utilized effectively