We will implement a task graph using Callable tasks, Future values, and an executor service style thread pool.
This page documents what we do in class. It contains code that we will discuss in class, reading assignments, simple homework exercises that you can work on for practice and exam preparation (not for credit), links to other sources of information, etc.
We will implement a task graph using Callable tasks, Future values, and an executor service style thread pool.
We will go back to task graphs and implement a simple task graph using a variety of techniques, from using raw threads, to using a thread pool.
We will look at compute-bound tasks on a thread pool and also the difference between the physical and logical cores of a cpu.
We will look at the basics of thread pools and how to schedule task graphs on a thread pool.
We will look at these examples of Readers–writer locks.
Read about Readers/Writer locks (pages 115 - 116) from this operating systems textbook.
The following article explains several implementations of read-write locks.
When you are connected to the campus network, download Chapter 7 from the book Java Threads and the Concurrency Utilities.
For next week, read Sections 3, 4, and 5 (pages 14--43) on Java's fork/join framework from the following.
We will look at these examples of "task scheduling" vs "thread synchronization".
See the programming assignment page for your third assignment.
We will finish these examples of simple task graph problems.
We will look at these examples of how to solve simple "task graph" problems (also called "dataflow" problems).
Read these two explanations of the difference between concurrency and parallelism.
Spring Break - No class today.
Spring Break - No class today.
We will look at these examples of how to solve a non-blocking I/O problem.
Read pages 23-44 from the following chapter about thread pools and task execution from Java Concurrency in Practice.
See the programming assignment page for your second assignment.
We will continue looking at these examples of the bounded buffer synchronization problem.
Here are Java API versions of "bounded buffers".
See the programming assignment page for your second assignment.
The first midterm exam, which the syllabus states will be one week from today, will be postponed to after spring break. There will be more information about what will be on the exam after spring break.
We will start looking at these examples of the bounded buffer synchronization problem.
We will finish looking at these examples of the producer/consumer synchronization problem.
We will start looking at these examples of the bounded buffer synchronization problem.
We will continue to look at these examples of the producer/consumer synchronization problem.
Read Section 4.5 (pages 117 - 122) about condition variables, from this operating systems textbook.
Here is a good explanation of solving the producer-consumer problem using condition variables (monitors), from this operating systems textbook, but it uses pthreads and C (instead of Java). You may find it useful.
We will start to look at these examples of the producer/consumer synchronization problem.
Read Section 4.3.2 and 4.3.3 (pages 103 - 112) about monitors, from this operating systems textbook.
Today we will finish these Java examples of race conditions, critical sections, and mutual exclusion.
Next week we will look at examples of the producer/consumer synchronization problem.
When you are connected to the campus network, download Chapter 2 from the book Java Threads and the Concurrency Utilities (you need to be on campus to access this book). The chapter is about race conditions and critical sections.
Download Chapter 3 from the book Java Threads and the Concurrency Utilities. The chapter is about the wait() and notify() methods and their use in the producer-consumer problem.
Today we will continue with these Java examples of race conditions, critical sections, and mutual exclusion.
Here is a brief explanation of synchronization for Java threads.
Read Section 4.4.1 (pages 113 - 114) about bounded buffers, and the producer/consumer problem, from this operating systems textbook.
Because of the weather, class met using the Zoom application.
Here is a link to today's video lecture.
Today we will look at these code examples that demonstrate race conditions and synchronization.
Read about race conditions and synchronization from the following two Java references.
Read Sections 4.1 and 4.2 (pages 93 - 98) about thread synchronization from this operating systems textbook.
Here are code examples that demonstrate race conditions and synchronization.
We will continue to look at these Java threads examples.
Here is a very general overview of Java threads written by one of the designers of the Java language.
We will begin looking at these Java threads examples.
Here are a few more introductions to Java threads that you might find useful.
We will finish looking at these pthreads examples.
NOTE: Starting today, the class will meet in room Gyte 211.
Here are three introductions to Java threads. Read the first three sections (the first 15 pages) from the first reference. Read the first four sections (the first 8 pages) from the second reference. Read Section 12.1 from the third reference.
Here are some simple code examples using Java threads.
I highly recommend that you read the following chapter from this operating systems textbook. It provides valuable background information for understanding thread scheduling.
See the programming assignment page for your first assignment.
Read the first three sections (pages 45 - 60) from the following chapter about thread scheduling from this operating systems textbook.
Here are some simple code examples using pthreads.
Here is a link to a C compiler that can compile, link, and run the pthread examples.
No class. Martin Luther King Jr. Day.
Read the following chapter about threads from this operating systems textbook.
Read the following chapter about processes from this operating systems textbook.
Here are some simple code examples for creating processes.