Efficient Java Multithreading and Concurrency with Executors

Learn how to use the modern Executors framework to do everything that you can do with the Threads API ... and more!

4.55 (1227 reviews)
Udemy
platform
English
language
Programming Languages
category
instructor
10,045
students
5.5 hours
content
Jun 2020
last update
$64.99
regular price

What you will learn

Exploit the ninja techniques learned from this course to write safe and error free multithreading code in the first iteration itself.

Become confident to move away from the old Threads-API and use the modern Executors-API for all multi-threading needs instead.

Understand and exploit the various pro techniques to avoid the pitfalls while using Executors.

Understand and leverage the similarities & differences between the Threads-API and the Executors-API.

Rightly judge which Executor pool to use for which needs.

Differentiate between safe and error-prone multi-threading code.

Appreciate the reasons why Executors API was built even though the Threads API already existed.

Write efficient multi-threading code by utilizing a plethora of pro tips and techniques.

Get the Source Code of all the examples!

Description

Learn all the concepts of Java's Executors API from scratch in combination with parallel concepts of the Threads API. Develop skills and deepen your knowledge of advanced multi-threading concepts by learning various tips & techniques and becoming aware of pitfalls when using Executors API. And ... refresh your advanced Threads-API concepts as well.

  • Do you know how to return values using the normal Threads API and its Runnables?

  • Do you know the various ways of terminating threads midway for both the APIs?

  • Do you know how to 'join threads' using Executors?

  • Do you know that you cannot catch stray exceptions leaked out from a thread by using try-catch block - neither in the Threads API nor in the Executors one? And that this can lead to third-party code killing your scalable, high-performance and high-availability enterprise application?

  • Do you know how to check if a task has finished execution using both the APIs?

  • Do you know what are daemon threads and how to create them using Executors?

  • Do you know how to name Executor threads?

  • Do you know the various ways to schedule tasks for running in future using both the APIs? Do you know the various 'types' of scheduling?

If the answer to any of these questions is 'no', then this course is for you (provided that you know Java and the basics of multi-threading already)! Learning from HD quality videos and nearly 6 hours of content will help you convert all these "nos" to "yeses" ... and will also give you an edge over your peers! Not only will this course help you learn how to get things done the multi-threaded way but also how to avoid the mistakes and pitfalls and thereby, increase your efficiency and productivity. All those long bug-fixing hours that you save can be spent finishing your other pending work or even for pleasure!

Avoid the pitfalls while writing multi-threaded code by learning pro-tips

In my 19 years of experience building large enterprise applications, I have made all the mistakes in multi-threading that can be made. And believe me - multi-threading bugs are costly and multi-weekend-destroying to resolve.

I have used my vast experience to craft this course in such a manner so as to highlight the pitfalls that await a programmer and also provide tips to avoid those pitfalls. By going through this course, you will be years ahead of your peers who are yet to make all the mistakes that I have made.

Content and Overview

It is difficult to directly move from an older to a newer way of doing things if you are not comfortable with the older way also - you won't be able to map things from the old way to the new way. So, this course has been structured in such a way that the Threads-API way of doing things are explained first and then the corresponding way to do them using the Executors-API is explained. This will help you understand not only the advanced concepts of Executors but also those of the Threads-API.

So, this course is suitable for programmers who want to learn about the Executors API from scratch. It is also beneficial for those who want to refresh their concepts or learn the techniques of doing various operations using the Threads-API. Detailed examples along with the source-code are provided on every concept for both the APIs.

The course starts with the basics first - 'How to create and run threads', 'How to name the threads' and 'How to return values from threads' - using both the APIs. And then, it gradually moves on to increasingly advanced concepts like 'Terminating Threads', 'Catching Exceptions', 'Waiting for threads to finish without wasting CPU cycles', etc.

BEFORE YOU BUY THIS COURSE, DON'T FORGET TO WATCH THE FREE PREVIEW VIDEO ON 'PRE-REQUISITES AND COURSE STRUCTURE' IN SECTION-1!

Content

INTRODUCTION

About the Course
About Me
Pre-Requisites And Course Structure
How to Download Source Code and 1080p Videos

CREATING AND RUNNING THE THREADS

Creating Threads Using the Threads-API - First Way
Creating Threads Using the Threads-API - Second Way
Creating Threads Using the Threads-API - Third Way
Creating Threads Using the Threads-API - Fourth Way
Creating Threads Using the Threads-API - Fifth Way
Executors Framework Overview
Important Interfaces And Classes In The Executors Framework
Creating Threads Using Executors Framework - Fixed Thread Pool
Creating Threads Using Executors Framework - Cached Thread Pool | Part-1
Creating Threads Using Executors Framework - Single Thread Executor

NAMING THE THREADS

Naming Normal Threads - First Way
Naming Normal Threads - Second Way
Naming Executor Threads
Creating Threads Using Executors Framework - Cached Thread Pool | Part-2

RETURNING VALUES FROM THREADS

Returning Values From Normal Threads - First Way
Returning Values From Normal Threads - Second Way
Returning Values From Executors - First Way
Returning Values From Executors - Second Way

CREATING DAEMON THREADS

Daemon Threads Using Threads-API
Daemon Threads Using Executors

CHECKING IF A THREAD IS ALIVE

Normal Threads Alive Check
Executor Threads Alive Check

TERMINATING THREADS

Terminating Normal Threads - First Way
Terminating Normal Threads - Second Way
Terminating Normal Blocked Threads
Terminating Executor Tasks - First Way
Terminating Blocked Executor Tasks
Terminating ALL Executor Tasks In One Shot | Part-1
Terminating ALL Executor Tasks In One Shot | Part-2

HANDLING UNCAUGHT EXCEPTIONS

Handling Uncaught Exceptions For Every Thread
Handling Uncaught Exceptions Differently For Each Thread
Handling Uncaught Exceptions - Defaults And Overrides
Handling Uncaught Exceptions In Executors For Every Thread
Handling Uncaught Exceptions In Executors Differently For Each Thread
Handling Uncaught Exceptions In Executors - Defaults And Overrides

WAITING FOR THREADS TO FINISH

Joining Other Threads Using the Normal Threads-API
Returning Values From Normal Threads - Third Way
Joining Executor Threads

SCHEDULING TASKS

Main Task Scheduling Classes and General Scheduling Concepts
Scheduling Tasks For One Time Execution Using Normal Threads | Part-1
Scheduling Tasks For One Time Execution Using Normal Threads | Part-2
Scheduling Tasks For Fixed DELAY Repeated Executions Using Normal Threads
Scheduling Tasks For Fixed RATE Repeated Executions Using Normal Threads
Important Interfaces and Classes for Scheduling Tasks Using Executors
Scheduling Tasks For One Time Execution Using Executors
Scheduling Tasks For Fixed DELAY Repeated Executions Using Executors | PART-1
Scheduling Tasks For Fixed DELAY Repeated Executions Using Executors | PART-2
Scheduling Tasks For Fixed RATE Repeated Executions Using Executors

EXERCISES

Exercises
Contest

CONCLUSION

Outro

Screenshots

Efficient Java Multithreading and Concurrency with Executors - Screenshot_01Efficient Java Multithreading and Concurrency with Executors - Screenshot_02Efficient Java Multithreading and Concurrency with Executors - Screenshot_03Efficient Java Multithreading and Concurrency with Executors - Screenshot_04

Reviews

Roxana
October 10, 2023
The information provided is good but is fundamental information. I was looking for something more advanced. Also, I think the class can be improved if the examples provided are stated as exercises: "How would you create a thread that return the sum of a and be using this method..." so whoever watches the videos can pause and write their own code and then compare it with the solution provided in the lessons. Second, the overview videos I think are unnecessary.
Sachin
July 18, 2023
Overall, a very good course. Everything discussed with thread API and executor API. Small Issues comes while working in multithreaded application discussed. Like how to terminate a thread or how to return value from thread or how to handler uncaught exception from thread. Thanks, You.
Emrah
September 8, 2022
Senkronizasyonlardan hiç bahsedilmeden bildiğimiz varsayılarak işlemleri yapıyor. Bunun dışında başlangıç seviyesi bir kurs.
Praveen
July 16, 2022
Good explanation, very good knowledge with coding examples. Just a suggestion please include some question/answer as well while explaining in terms of interview.
Nagendra
June 29, 2022
public class CourseFeedbackEncryptedInClass { public static void main (String args[]) { int[] x= {0,-3,8,-17,-6,13}; int y=Thread.currentThread().getStackTrace()[1].getClassName().length(); try { System.out.println(args[6]); } catch (Exception e) { for(int i=0;i<Integer.parseInt((e.toString().toUpperCase().split(":"))[1].trim());i++) System.out.print((e.toString().toUpperCase().split(":"))[0].trim().charAt(y+=x[i])); } } }
Ahatesham
May 28, 2022
Way of explanation is not good. seems like speaker is reading from book. Not cover deadlock and semaphore.
Abhishek
January 8, 2022
course is very basic and does not cover the internal of threading and no deep dive into threading concepts. Really dissapointed
Solomon
December 11, 2020
Instructor speak too much at the begining then jumping to the actual coding he use very basic examples
Narayan
October 19, 2020
Well explained Topics Only thing I felt basics topic being covered Need to add on some more advanced concepts on MultiThreading Still giving 5 star for appreciating instructor hardwork he put in.
Athar
March 1, 2018
Ofcourse, the material explains every thing in detail. There should be a short note, so that we could revise the thing in quick way, as there a number of technologies to be kept in mind for interview and development purpose.
Ronak
March 25, 2017
Amazing insights and great level of detail on basic Multi threading features and implementation in Java
Maneesh
February 1, 2017
Reached section 6 so far , and i must say the course is worth doing. The tutorials are challenging at the same time easy to understand.concept wise the approach of explaining the concepts first in threads api and then in executors is really amazing as it brushes the concepts of threads api too at the same time it encourage you to experiment more.Only donwside is Arun types too much code manually rather then just doing copy paste , which otherwise can save time and prevents user from undue distraction :-)
Sheena
January 18, 2017
I already knew the basics of multithreading but was not comfortable with advanced concepts. This course has helped me grasp a good understanding of those concepts. Examples given are to the point and easy to understand. Excellent course overall.
Vimal
January 17, 2017
The material is of basic nature, BUT the presentation is very good, so I gave 5*. It is certainly not of advanced nature.
stephen
January 14, 2017
Detailed lectures, but often repetitive. I HAVE, however learned a lot about multi threading and the Executor framework and am anxious to get on with the later lessons. I will say that this series of lectures did help me finish a multi-threading project at work, make the code much more understandable. I especially was able to use the section on "Promises" to create multiple threads, and join the results together in a most efficient manner.

Charts

Price

Efficient Java Multithreading and Concurrency with Executors - Price chart

Rating

Efficient Java Multithreading and Concurrency with Executors - Ratings chart

Enrollment distribution

Efficient Java Multithreading and Concurrency with Executors - Distribution chart

Related Topics

498706
udemy ID
5/11/2015
course created date
4/1/2020
course indexed date
Angelcrc Seven
course submited by