PDC Lecture 2
PDC Lecture 2
processor
◼ High performance L2 Cache
without driving up
power consumption
Main Memory
Dual-core Architecture
Advantages ?
CPU
CPU1 CPU2
Single-core Dual-core
Large tasks running Large tasks can be
simultaneously slow down processed in separate CPUs
Understanding Threads and Cores
Threads Cores
•A thread is a sequence of instructions that •A core is an independent processing unit
can be executed independently by a within a processor.
processor. •Each core can execute multiple threads
•Multiple threads can be executed simultaneously, allowing for parallel
simultaneously by a processor, allowing for processing.
parallel processing. •Having multiple cores in a processor can
•Threads can improve the performance significantly improve the performance and
and efficiency of software applications by multitasking capabilities of a computer
utilizing the available processing resources system.
more effectively.
Benefits of Multithreading
• Improved Performance
Multithreading allows for concurrent execution of
multiple threads, which can result in improved
performance and faster execution times. By dividing tasks
into smaller threads that can run simultaneously, the
overall processing time can be significantly reduced.
• Resource Utilization
Multithreading enables better utilization of
system resources, such as CPU cores and
memory. By efficiently distributing tasks
across multiple threads, the system can
make use of idle resources and maximize
overall efficiency. This can lead to better
scalability and responsiveness of applications.
Limitations of Multithreading
• Increased Complexity
• Multithreading introduces additional
complexity to software development,
making it more challenging to write and
maintain code.
• Potential for Race Conditions
• When multiple threads access
shared resources concurrently,
race conditions can occur,
leading to unpredictable and
erroneous behavior.