Coursera
Explore
  • Browse
  • Search
  • For Enterprise
  • Log In
  • Sign Up

Concurrent Programming in Java

OverviewSyllabusFAQsCreatorsPricingRatings and Reviews

HomeComputer ScienceSoftware Development

Concurrent Programming in Java

Rice University

About this course: This course teaches learners (industry professionals and students) the fundamental concepts of concurrent programming in the context of Java 8. Concurrent programming enables developers to efficiently and correctly mediate the use of shared resources in parallel programs. By the end of this course, you will learn how to use basic concurrency constructs in Java such as threads, locks, critical sections, atomic variables, isolation, actors, optimistic concurrency and concurrent collections, as well as their theoretical foundations (e.g., progress guarantees, deadlock, livelock, starvation, linearizability). Why take this course? • It is important for you to be aware of the theoretical foundations of concurrency to avoid common but subtle programming errors. • Java 8 has modernized many of the concurrency constructs since the early days of threads and locks. • During the course, you will have online access to the instructor and mentors to get individualized answers to your questions posted on the forums. • Each of the four modules in the course includes an assigned mini-project that will provide you with the necessary hands-on experience to use the concepts learned in the course on your own, after the course ends. The desired learning outcomes of this course are as follows: • Concurrency theory: progress guarantees, deadlock, livelock, starvation, linearizability • Use of threads and structured/unstructured locks in Java • Atomic variables and isolation • Optimistic concurrency and concurrent collections in Java (e.g., concurrent queues, concurrent hashmaps) • Actor model in Java Mastery of these concepts will enable you to immediately apply them in the context of concurrent Java programs, and will also help you master other concurrent programming system that you may encounter in the future (e.g., POSIX threads, .NET threads).

Who is this class for: The course is targeted at an audience that is already familiar with sequential programming in Java, including a basic knowledge of Java 8 lambdas. In addition, we assume that each student has access to a laptop/desktop computer with a recent installation of Java 8. The course site includes instructions on how to obtain this installation, if needed.


Created by:  Rice University
Rice University

  • Vivek Sarkar

    Taught by:  Vivek Sarkar, Professor

    Department of Computer Science
Basic Info
Course 2 of 3 in the Parallel, Concurrent, and Distributed Programming in Java Specialization
LevelIntermediate
CommitmentFour weeks of study, 4-8 hours/week depending on past experience with sequential programming in Java
Language
English
Hardware ReqAccess to a computer that can run Java 8 programs for optional course projects
How To PassPass all graded assignments to complete the course.
User Ratings
4.4 stars
Average User Rating 4.4See what learners said
Syllabus
WEEK 1
Welcome to the Course!
Welcome to Concurrent Programming in Java! This course is designed as a three-part series and covers a theme or body of knowledge through various video lectures, demonstrations, and coding projects.
1 video, 5 readings
  1. Video: Course Welcome
  2. Reading: General Course Info
  3. Reading: Course Icon Legend
  4. Reading: Discussion Forum Guidelines
  5. Discussion Prompt: Get to Know Your Classmates!
  6. Reading: Pre-Course Survey
  7. Reading: Mini Project 0: Setup
  8. Ungraded Programming: Mini Project 0 Submission
Threads and Locks
In this module, we will learn about threads and locks, which have served as primitive building blocks for concurrent programming for over five decades. All computing platforms today include some form of support for threads and locks, and make them available for use by developers in a wide range of programming languages. We will learn how threads can be created, joined, and synchronized using structured (e.g., synchronized statements/methods) and unstructured (e.g., java.util.concurrent libraries) locks in Java. We will also learn about new classes of bugs that can arise when concurrent programs need to access shared resources. These bugs are referred to as violations of liveness/progress guarantees, and include deadlock, livelock, and starvation. We will conclude this module by studying different solutions to the classical "Dining Philosophers" problem, and use these solutions to illustrate instances of deadlock, livelock and starvation.
6 videos, 6 readings
  1. Video: 1.1 Threads
  2. Reading: 1.1 Lecture Summary
  3. Video: 1.2 Structured Locks
  4. Reading: 1.2 Lecture Summary
  5. Video: 1.3 Unstructured Locks
  6. Reading: 1.3 Lecture Summary
  7. Video: 1.4 Liveness
  8. Reading: 1.4 Lecture Summary
  9. Video: 1.5 Dining Philosophers
  10. Reading: 1.5 Lecture Summary
  11. Reading: Mini Project 1: Locking and Synchronization
  12. Video: Demonstration: Locking and Synchronization
Graded: Mini Project 1 Submission
Graded: Module 1 Quiz
WEEK 2
Critical Sections and Isolation
In this module, we will learn different approaches to coordinating accesses to shared resources without encountering the deadlock or livelock bugs studied earlier. Critical/isolated sections are higher-level concurrent programming constructs (relative to locks) that simplify the implementation of mutual exclusion by guaranteeing the absence of deadlocks and livelocks. Object-based isolation relaxes the constraints imposed by critical sections by allowing mutual exclusion to be specified on a per-object basis, as illustrated in the Spanning Tree example. Java's atomic variables represent an important, but restricted, case of object-based isolation that is implemented efficiently on all hardware platforms. Finally, we will learn how object-based isolation can be further relaxed with read/write access modes.
6 videos, 6 readings
  1. Video: 2.1 Critical Sections
  2. Reading: 2.1 Lecture Summary
  3. Video: 2.2 Object Based Isolation (Monitors)
  4. Reading: 2.2 Lecture Summary
  5. Video: 2.3 Concurrent Spanning Tree Algorithm
  6. Reading: 2.3 Lecture Summary
  7. Video: 2.4 Atomic Variables
  8. Reading: 2.4 Lecture Summary
  9. Video: 2.5 Read, Write Isolation
  10. Reading: 2.5 Lecture Summary
  11. Reading: Mini Project 2: Global and Object-Based Isolation
  12. Video: Demonstration: Global and Object-Based Isolation
Graded: Mini Project 2 Submission
Graded: Module 2 Quiz
Talking to Two Sigma: Using it in the Field
Join Professor Vivek Sarkar as he talks with Software Engineer, Dr. Shams Imam, at their downtown Houston, Texas office about threads, locks, deadlocks, high-level and low-level constructs, and the importance of concurrent programming.
2 videos, 1 reading
  1. Reading: About these Talks
  2. Video: Industry Professional on Parallel, Concurrent, and Distributed Programming in Java - Jim Ward, Managing Director
  3. Video: Industry Professional on Concurrency - Dr. Shams Imam, Software Engineer
WEEK 3
Actors
In this module, we will learn another high-level approach to concurrent programming called the "Actor" model. A major difference between the Actor model and the Isolated Sections model is that there are no data races possible in the Actor model because it does not allow for any form of shared variables. However, as in all concurrent programming models, higher-level forms of nondeterminism are still possible in the Actor model due to an inherent asynchrony in the order in which messages may be delivered. We will study multiple examples of concurrency using the Actor model, including the classical Sieve of Eratosthenes algorithm to generate prime numbers, as well as producer-consumer patterns with both unbounded and bounded buffers.
6 videos, 6 readings
  1. Video: 3.1 Actors
  2. Reading: 3.1 Lecture Summary
  3. Video: 3.2 Actor Examples
  4. Reading: 3.2 Lecture Summary
  5. Video: 3.3 Sieve of Eratosthenes Algorithm
  6. Reading: 3.3 Lecture Summary
  7. Video: 3.4 Producer-Consumer Problem
  8. Reading: 3.4 Lecture Summary
  9. Video: 3.5 Bounded Buffer Problem
  10. Reading: 3.5 Lecture Summary
  11. Reading: Mini Project 3: Sieve of Eratosthenes Using Actor Parallelism
  12. Video: Demonstration: Sieve of Eratosthenes Using Actor Parallelism
Graded: Mini Project 3 Submission
Graded: Module 3 Quiz
WEEK 4
Concurrent Data Structures
In this module, we will study Concurrent Data Structures, which form an essential software layer in all multithreaded programming systems. First, we will learn about Optimistic Concurrency, an important multithreaded pattern in which two threads can "optimistically" make progress on their assigned work without worrying about mutual conflicts, and only checking for conflicts before "committing" the results of their work. We will then study the widely-used Concurrent Queue data structure. Even though the APIs for using concurrent queues are very simple, their implementations using the Optimistic Concurrency model can be complex and error-prone. To that end, we will also learn the formal notion of Linearizability to better understand correctness requirements for concurrent data structures. We will then study Concurrent Hash Maps, another widely-used concurrent data structure. Finally, we discuss a concurrent algorithm for finding a Minimum Spanning Tree of an undirected graph, an algorithm that relies on the use of Concurrent Data Structures under the covers.
6 videos, 7 readings
  1. Video: 4.1 Optimistic Concurrency
  2. Reading: 4.1 Lecture Summary
  3. Video: 4.2 Concurrent Queue
  4. Reading: 4.2 Lecture Summary
  5. Video: 4.3 Linearizability
  6. Reading: 4.3 Lecture Summary
  7. Video: 4.4 Concurrent Hash Map
  8. Reading: 4.4 Lecture Summary
  9. Video: 4.5 Concurrent Minimum Spanning Tree Algorithm
  10. Reading: 4.5 Lecture Summary
  11. Reading: Mini Project 4: Parallelization of Boruvka's Minimum Spanning Tree Algorithm
  12. Video: Demonstration: Parallelization of Boruvka's Minimum Spanning Tree Algorithm
  13. Reading: Exit Survey
Graded: Mini Project 4 Submission
Graded: Module 4 Quiz
Continue Your Journey with the Specialization "Parallel, Concurrent, and Distributed Programming in Java"
The next two videos will showcase the importance of learning about Parallel Programming and Distributed Programming in Java. Professor Vivek Sarkar will speak with industry professionals at Two Sigma about how the topics of our other two courses are utilized in the field.
2 videos, 1 reading
  1. Reading: Our Other Course Offerings
  2. Video: Industry Professionals on Parallelism - Jake Kornblau and Margaret Kelley, Software Engineers, Two Sigma
  3. Video: Industry Professional on Distribution - Dr. Eric Allen, Senior Vice President, Two Sigma

FAQs
How It Works
Coursework
Coursework

Each course is like an interactive textbook, featuring pre-recorded videos, quizzes and projects.

Help from Your Peers
Help from Your Peers

Connect with thousands of other learners and debate ideas, discuss course material, and get help mastering concepts.

Certificates
Certificates

Earn official recognition for your work, and share your success with friends, colleagues, and employers.

Creators
Rice University
Rice University is consistently ranked among the top 20 universities in the U.S. and the top 100 in the world. Rice has highly respected schools of Architecture, Business, Continuing Studies, Engineering, Humanities, Music, Natural Sciences and Social Sciences and is home to the Baker Institute for Public Policy.
Pricing
Purchase Course
Access to course materials

Available

Access to graded materials

Available

Receive a final grade

Available

Earn a shareable Course Certificate

Available

Ratings and Reviews
Rated 4.4 out of 5 of 180 ratings

XX

The feedback will be similar to the first course, parallel programming in java, such that the course contents are good. The lecturer can explain the theory very well. But the homework is just repeating of the demo video. I hope we can have the opportunity to practice the actual thread creation, joining, etc. instead of using the API call.

MC

very nice content and throughly articulated the difficult topic

CM

Great introduction to concurrent programming concepts. Well-paced. Instructor is clear and personable. The mini-projects feel a little too easy sometimes, but at that point it's up to me to dig deeper and learn more on the topics. I enjoyed this course very much.

Keesun Baik

Very well organized course



You May Also Like
Rice University
Distributed Programming in Java
1 course
Rice University
Distributed Programming in Java
View course
Rice University
Parallel Programming in Java
1 course
Rice University
Parallel Programming in Java
View course
University of Alberta
Design Patterns
1 course
University of Alberta
Design Patterns
View course
University of Alberta
Software Architecture
1 course
University of Alberta
Software Architecture
View course
University of Alberta
Service-Oriented Architecture
1 course
University of Alberta
Service-Oriented Architecture
View course
Coursera
Coursera provides universal access to the world’s best education, partnering with top universities and organizations to offer courses online.
© 2018 Coursera Inc. All rights reserved.
Download on the App StoreGet it on Google Play
  • Coursera
  • About
  • Leadership
  • Careers
  • Catalog
  • Certificates
  • Degrees
  • For Business
  • For Government
  • Community
  • Partners
  • Mentors
  • Translators
  • Developers
  • Beta Testers
  • Connect
  • Blog
  • Facebook
  • LinkedIn
  • Twitter
  • Google+
  • Tech Blog
  • More
  • Terms
  • Privacy
  • Help
  • Accessibility
  • Press
  • Contact
  • Directory
  • Affiliates