Threading: Lesson
Lesson 1 of 1
  1. 1
    So far, we have learned about threads and how they work in theory. Before we put it into practice, we should have a strong understanding of what kinds of problems multi-threaded programs are best s…
  2. 2
    There are multiple ways to implement threading in Java. The first that we will try involves extending the Thread class. In Java, there is a built-in class that handles threads: java.lang.Thread. …
  3. 3
    In the previous exercise, you learned that you can convert a class to run as a thread by extending the Thread class. Java allows us to make classes threaded in another way as well, by implementing …
  4. 4
    So far, you have seen how to start threads with the .start() method and learned multiple ways to implement threads into sequential programs. Sometimes, you want to be able to see the status of th…
  5. 5
    Another common scenario in multi-threaded programs is to wait for a thread to complete before proceeding in a path of execution. In other languages, this concept is called “awaiting” or “blocking…
  6. 6
    Another important scenario when working with multi-threaded programs is managing shared resources between threads. When you access the same data from two different threads, you may cause a _rac…
  7. 7
    Previously, we learned how to block thread execution using .join(). However, this is only to block thread execution from the context where the thread was started. For example, if a thread was creat…
  8. 8
    Congratulations on completing this lesson on threading! So far, you have: - created threads in three different ways: - extending the Thread class - implementing the Runnable class - using the …

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo