Multicore Programming

Multithreaded Server Architecture

Pros of Multithreading
- Responsiveness - allows for processing to continue even if apart of a process is blocked
- Resource Sharing - threads can easily share data between each other because they are apart of the same process
- Economy - thread switching is cheaper than context switching
- Scalability - can make full use of multicore
Concurrency vs Parallelism
Parallelism - implies a system can perform more than one task simultaneously
Concurrency - supports more than one task making progress (Single processor / core, scheduler providing concurrency)

Data and Task Parallelism

Data parallelism (same op) – distributes subsets of the same data across multiple cores, same operation on each
Task parallelism (diffrent op) – distributing threads across cores, each thread performing unique operation
Amdahl's Law
Performance gains from having additional cores

S serial portion (measure of how much adding extra cores will effect the programs speed)
N processing cores
