Efficient Java Multithreading with Executors

Learn how to use the modern Executors framework to do everything that you can do with the Threads API ... and more!
4.2 (94 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
1,183 students enrolled
$60
Take This Course
  • Lectures 56
  • Contents Video: 7.5 hours
    Other: 8 mins
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 6/2015 English

Course Description

A 7.5-hours course on multi-threading - it cannot get more detailed than that! 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 Full-HD (1080p) videos and nearly 8 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 13 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!

What are the requirements?

  • You should already have a solid grasp of Core Java.
  • You should already know about the basic concepts of multi-threading viz. what are threads, why are threads required, various states they can be in, what is synchronization, what is locking, etc.
  • You should have Eclipse IDE and JDK 1.7 or higher installed on your machine.
  • You should already know how to use Eclipse IDE for Java programming.

What am I going to get from this course?

  • Get the Source Code of all the examples!
  • Get superb quality, full-HD (1080p) videos explaining theory as well as showing detailed coding examples.
  • Become confident to move away from the old Threads-API and use the modern Executors-API for all multi-threading needs instead.
  • Exploit the Ninja Techniques learned from this course to write safe and error free multithreading code in the first iteration itself.
  • 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.

What is the target audience?

  • This course is meant for all Java professionals who are familiar with Java's Threads-API but who are not comfortable with the Executors-API yet. For example - if you know how to terminate normal threads but not how to terminate Executor tasks or threads, then this course is for you.
  • Even if you do not know how to terminate normal threads, return values from normal threads and the like - then also this course is for you. Professionals who are still using the old Threads-API and want to have more practical knowledge about some advanced concepts of this API can also benefit from this course as Threads-API is also covered in detail.
  • If you love to have deep knowledge of underlying concepts of a technology or topic rather than just shallow familiarity, then this course is for you.
  • This course is probably not for you if you are looking to learn about Java multi-threading from scratch!
  • This course is definitely not for you if you do not know how to code in Java!

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: INTRODUCTION
About the Course
Preview
02:47
About Me
Preview
01:43
Pre-Requisites And Course Structure
Preview
03:18
How to Download Source Code and 1080p Videos
3 pages
Section 2: CREATING AND RUNNING THE THREADS
Creating Threads Using the Threads-API - First Way
Preview
10:25
Creating Threads Using the Threads-API - Second Way
04:27
Creating Threads Using the Threads-API - Third Way
04:32
Creating Threads Using the Threads-API - Fourth Way
03:49
Creating Threads Using the Threads-API - Fifth Way
03:53
Executors Framework Overview
04:05
Important Interfaces And Classes In The Executors Framework
Preview
10:36
Creating Threads Using Executors Framework - Fixed Thread Pool
Preview
10:32
Creating Threads Using Executors Framework - Cached Thread Pool | Part-1
05:27
Creating Threads Using Executors Framework - Single Thread Executor
03:09
Section 3: NAMING THE THREADS
Naming Normal Threads - First Way
13:35
Naming Normal Threads - Second Way
06:44
Naming Executor Threads
07:41
Creating Threads Using Executors Framework - Cached Thread Pool | Part-2
03:50
Section 4: RETURNING VALUES FROM THREADS
Returning Values From Normal Threads - First Way
20:23
Returning Values From Normal Threads - Second Way
08:39
Returning Values From Executors - First Way
10:06
Returning Values From Executors - Second Way
13:56
Section 5: CREATING DAEMON THREADS
Daemon Threads Using Threads-API
09:48
Daemon Threads Using Executors
06:32
Section 6: CHECKING IF A THREAD IS ALIVE
Normal Threads Alive Check
09:48
Executor Threads Alive Check
17:08
Section 7: TERMINATING THREADS
Terminating Normal Threads - First Way
08:55
Terminating Normal Threads - Second Way
13:24
Terminating Normal Blocked Threads
13:32
Terminating Executor Tasks - First Way
08:37
Terminating Executor Tasks - Second Way
13:26
Terminating Blocked Executor Tasks
09:18
Terminating ALL Executor Tasks In One Shot | Part-1
11:46
Terminating ALL Executor Tasks In One Shot | Part-2
10:14
Section 8: HANDLING UNCAUGHT EXCEPTIONS
Handling Uncaught Exceptions For Every Thread
13:51
Handling Uncaught Exceptions Differently For Each Thread
04:51
Handling Uncaught Exceptions - Defaults And Overrides
06:15
Handling Uncaught Exceptions In Executors For Every Thread
05:31
Handling Uncaught Exceptions In Executors Differently For Each Thread
05:22
Handling Uncaught Exceptions In Executors - Defaults And Overrides
05:37
Section 9: WAITING FOR THREADS TO FINISH
Joining Other Threads Using the Normal Threads-API
09:16
Returning Values From Normal Threads - Third Way
07:23
Joining Executor Threads
13:05
Section 10: SCHEDULING TASKS
Main Task Scheduling Classes and General Scheduling Concepts
06:49
Scheduling Tasks For One Time Execution Using Normal Threads | Part-1
15:31
Scheduling Tasks For One Time Execution Using Normal Threads | Part-2
09:57
Scheduling Tasks For Fixed DELAY Repeated Executions Using Normal Threads
14:31
Scheduling Tasks For Fixed RATE Repeated Executions Using Normal Threads
05:14
Important Interfaces and Classes for Scheduling Tasks Using Executors
06:17
Scheduling Tasks For One Time Execution Using Executors
17:05
Scheduling Tasks For Fixed DELAY Repeated Executions Using Executors | PART-1
09:49
Scheduling Tasks For Fixed DELAY Repeated Executions Using Executors | PART-2
05:31
Scheduling Tasks For Fixed RATE Repeated Executions Using Executors
04:08
Section 11: EXERCISES
Exercises
2 pages
Contest
1 page
Section 12: CONCLUSION
Outro
2 pages

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Arun Kumar, Technical Architect and Software Engineer

I am a software professional with around 14 years of experience building multi-tier enterprise systems for large investment banks, financial services providers and telecom companies. Right now, I am working with a multi-national telecom company based out of US.

Most of my experience has been on Java/JEE and related technologies only but I have worked on IBM Mainframes and some Microsoft technologies as well.

My main areas of expertise are Core Java, Web-programming using JSPs and Servlets, Groovy, Grails, Spring, Hibernate, OSGi, Eclipse RCP, Eclipse RAP and creating DSLs using Xtext & Xtend.

I have been involved in building architecture and design of multiple applications with requirements of high-performance, high-availability, scalability, interoperability and high-maintainability.

Ready to start learning?
Take This Course