Concurrency
Task
Unit of a program that can be executed concurrently with other units of a program.
Parallell programming
Concurrency in an application is achieved as a collaboration between three components…
Underlying hardware: must support multithreading/processing.
Operating system: Must also support multithreading.
Application: Designed & contain algorithms to make best use of underlying OS & hardware.
Multiprocessing
Using multiple processes (applications at run-time)
Multithreading
Using multiple threads withing a process.
Application
Scheduler
Interrupts
Multitasking
OS quickly switches between computing tasks; gives impression of diff. applications executing multiple actions simultaneously.
Multithreading
Form of multitasking w/in application. Executes several tasks concurrently (at the same time).
Process
Process and memory isolation
Threads & Processes
Thread
Single-threading
Single path of execution; Application run by a single thread. Runs sequentially.
Sequential application
Concurrent application
Parallelism
Context Switching
Benefits multithreading
When to use Multithreading?
When not to use multithreading?
Synchronization – why need it?