ECE344-Lecture5-Threads

ECE344-Lecture5-Threads - Lecture 5: Threads David Lie...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Lecture 5: Threads David Lie ECE344 University of Toronto
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 ECE344: Operating Systems Overview Programs and thread abstraction Thread scheduling Thread creation and termination Kernel threads vs. user threads
Background image of page 2
3 ECE344: Operating Systems Threads A thread is a stream of instructions that are executed on the processor: – By default processor executes the next instruction – Branches can jump to different parts of the program, but it’s the same thread The abstraction of a thread separates the software concept of a program (a thread) from the hardware that runs the program (a processor): – In this way there does not have to be a 1:1 correspondence between programs and processors – Typically more threads than physical processors
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 ECE344: Operating Systems Threads
Background image of page 4
5 ECE344: Operating Systems Motivation Threads permit concurrency , which means that different operations can be interleaved with each other, appearing to execute “concurrently”. Concurrency has two main benefits: – Latency hiding: If one thread has to wait for something (i.e. a slow device, the user), then another thread can run while the first thread blocks. Where have we seen this already? – Parallelism: If there is more than one core/processor available, several threads can run concurrently and utilize the additional cores.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 ECE344: Operating Systems Motivation
Background image of page 6
7 ECE344: Operating Systems Virtualization
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 17

ECE344-Lecture5-Threads - Lecture 5: Threads David Lie...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online