Java Multithreading

This training focuses on multithreading, concurrency and parallel programming in Java from low level aspects to high level API elements in order to create asynchronous code.
Code: JVA-054
Duration: 16 hours

Description

This training focuses on multithreading, concurrency and parallel programming in Java from low level aspects to high level API elements in order to create asynchronous code. Each chapter focuses on one of the API elements like Threads, Locks, Synchronizers etc. The course does not cover external tools and libraries.

Roadmap

Theory
  • Multithreading and multiprocessing
  • Basic concepts – process, thread, scheduler
  • Parallelism and Concurrency
  • Amdahl’s and Gustafson laws
  • Types of multithreading
  • Multithreading application in Java

Creating Threads
  • Thread as object; creating and running thread
  • Implementation of Runnable
  • Extending Thread class
  • Comparing Runnable and Thread
  • Using ThreadFactory
  • Thread lifecycle
  • Thread states

Interrupting Threads
  • Returning from run method
  • Using sleep method
  • Using interrupt method
  • isInterrupted and interrupted methods
  • Using stop method
  • Using thread yield
  • Thread states diagram

Priorities and demonology
  • Thread priorities
  • Priorities in operating system
  • Demon threads
  • Infrastructure threads

Synchronization – basics
  • Time synchronization – time sort
  • Lost update problem
  • Ways to synchronize threads
  • Costs of synchronization
  • Synchronize keyword
  • Monitors
  • Synchronization blocks
  • Producer – Consumer pattern
  • Wait, notify and thread lifecycle
  • Wait vs sleep
  • Producer – Consumer pattern with pipes

Deadlock
  • What is deadlock?
  • Examples of deadlocks

Volatile and Atomic Values
  • Memory access performance
  • CPU memory model
  • Compiler and CPU
  • Java memory model
  • volatile keyword
  • CAS algorithm
  • Atomic References
  • Atomic counter example

Collections
  • Lost insert (update) problem
  • Synchronized collections
  • Concurrent library
  • Concurrent collections
  • Queue and Deque
  • BlockingQueue

Lock and semaphore
  • Lock interface
  • Condition in locks
  • ReadWriteLock
  • Semaphore interface

Synchronizers
  • Introduction – where to put semaphore where synchronizer
  • CountDownLatch
  • TransportTyconTutor – full example of using synchronizers and semaphores!
  • CyclicBarrier
  • Phaser
  • Phaser phases and tutor

Executor Framework
  • Why we need ExecutorFramework
  • Executor and ExecutorService
  • ThreadPool
  • Scheduling tasks
  • Running tasks
  • Stoping tasks
  • Future interface

ForkJoinFramework
  • Why we need ForkJoinFramework
  • Basics – divide and conquer algorithm
  • Limitations
  • Elements – Pool and task
  • Recursive actions and tasks
  • Common workflow
  • Asynchronous search

Asynchronous programming
  • Asynchronous and synchronous programming
  • CompletableFuture interface
  • Chaining and composing CompletableFutures
  • Method sumary

Storing data in Threads
  • Sharing runnable objects between threads
  • Overriding values in objects
  • ThreadLocal Store

Exception handling
  • Exceptions in multithreading application
  • Handling Exception with UncatchingExceptinoHandler

Objectives

Improve Java development skills with regard to multithreading by discussion and analysis of practical cases.

Target Audience

Junior and intermediate Java developers as well as Senior java developers who would like to learn more advanced elements of API.


Register for the next course
+
Registering in advance ensures you have priority. We’ll notify you when we schedule the next course on this topic
Bucharest €315
Krakow €315
Wroclaw €315

Invoices for the course will be issued in local currency. All fees above can change according to training location and delivery mode and are subject to change while scheduling. For individual participants the price is as displayed. For legal entities VAT is added to the displayed price.

Courses you may be interested in:

Recommended Reading:

  • Java 7 Concurrency Cookbook - Fernandez Javier
  • Java Concurrency in Practice – Brian Goetz et al.
  • JSR 133 – Java memory model specification
  • Java Language Specification chapter 17.

Sign up

First Name*
Last Name*
Company
Email*
Preferred Location
Phone
Your Comment
Luxoft Warsaw - Warsaw Spire, plac Europejski 1, 00-844 Warszawa
Dimitrie Pompeiu nr 5-7 , building C, Et. 5, sect 2, Bucharest, 014459

Contact phone:

021 371 4858
Luxoft Poland Wroclaw - Silver Tower pl. Konstytucji 3-go Maja 3 50-048 Wroclaw
Aleja Generała Tadeusza Bora-Komorowskiego 25, Quattro Business Park Five, 31-476 Kraków, Poland

Contact phone:

+48 122110650
Success
Thank you.
Your request has been received.