Save this video free

ECE344 Fall 2026 (Sec 1) Lec 13 - Threads

Jon Eyolfson · 53:47 · Watch on YouTube

Part of University of Toronto ECE 344. See all 26 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Jon Eyolfson distinguishes concurrency, switching among tasks, from parallelism, running tasks simultaneously, then explains how threads add multiple execution contexts inside one process. Using POSIX Pthreads, he demonstrates thread creation, scheduling, joining, detaching, exit behavior, stack attributes, and why passing a pointer to a short-lived stack variable can produce incorrect thread arguments.

Key takeaways

Chapters

0:00 Course Transition: From Test One to Threads
3:25 Concurrency Versus Parallelism Through Everyday Tasks
8:47 Threads Add Execution Contexts Inside a Process
13:21 Choosing Threads or Processes: Sharing, Cost, and Failure
17:10 POSIX Pthreads and the `pthread_create` Interface
22:00 Thread Scheduling, `pthread_join`, and Program Lifetime
29:40 Thread Exit Semantics and Detached Threads
39:10 Pthread Attributes and the Default Stack Size
40:50 Launching Four Threads and Passing IDs on the Heap
46:50 Why Passing a Loop Variable’s Stack Address Breaks

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:09 have lecture on the test. >> Sorry. >> Nope. >> They're built into the schedule. Alrighty, welcome back to operating

3:28 system. So, as a reward for finishing test one, we get to start the next hardest topic, threads. Yay. So, we will we'll talk about test one. It's being graded right now. It's like half done. So, we'll talk about that on Tuesday if we need to do anything about it. But for now, let us move on to threads. Some of you might have experience with this, some of you may not. We'll we'll get into it today. So before I even start, we have to talk about concurrency and parallelism. They might be synonyms to normal people, not to us. They are not the same when we're talking about software. So concurrency is switching between two or more things. question you should ask here is can you be interrupted? So the goal is to make

4:16 progress on all of them. So you can do this even with a single CPU handle multiple tasks. We kind of saw that a little bit. Signal handles was another example of that. Your program can be interrupted. So that is what concurrency is. That is doing still only doing one thing at one time instant but it's being able to switch between multiple things. While parallelism that's running two or more things at the exact same time. So the question you ask here are they independent? Can I do them both at the exact same time instance? And the goal is to run as fast as possible. Even in my watch I have two CPU cores on my watch. So we're going to have parallelism. That means I can run multiple things at the same time which gives us as the operating system more

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Jon Eyolfson.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.