filmov
tv
Advanced Multithreading Java Concept - Using Locks and Semaphores Part - 2

Показать описание
In this course called Using Locks and Semaphores for the Producer/Consumer Pattern.
Now we have two ways of synchronizing in the Java language, the synchronized keyword that can be used in several ways and the volatile keyword that we can use on failed declarations.
Those two keywords are related to what is called intrinsic locking. There is also explicit locking, and this is what we are going to see first mainly based on the use of a lock interface.
Then, we will see that using this lock interface and the condition interface we can implement the wait/notify pattern in a different and more powerful way. And then, we will see what's semaphores are. Semaphores are not a new concept in Java. It is a concept that comes from operating system and that is implemented in other languages. We will see the Java flavor of semaphores.
TIMESTAMPS
0:00 Module Agenda
1:05 What Is Wrong with Intrinsic Locking and Synchronization?
2:38 Introducing API Locking with the Lock Interface
3:59 Differences Between Synchronization and API Locking
4:37 Lock Patterns: Interruptible Lock Acquisition
5:34 Lock Patterns: Timed Lock Acquisition
6:16 Lock Patterns: Fair Lock Acquisition
7:29 Wrapping-up the Lock Pattern
8:15 Producer / Consumer Pattern: Wait / Notify Implementation
9:52 Producer / Consumer Pattern: Lock Implementation with Condition
11:15 The Condition Object: Interruptibility and Fairness
12:56 Wrapping-up the Lock and Condition Objects
13:17 Introducing the ReadWriteLock Pattern
14:49 Implementing an Efficient Concurrent Cache with ReadWriteLock
16:04 Wrapping-up the ReadWriteLock Pattern
16:47 Introducing the Semaphore Pattern, First Example
18:27 Semaphore Pattern: Interruptibility and Timed Permit Acquisition
19:39 Wrapping-up the Semaphore Pattern, Control of the Waiting Threads
20:54 Live Coding: Producer / Consumer Based on the Lock Pattern
23:22 Live Coding: Setting up Conditions on the Producer / Consumer
26:07 Live Coding: Setting up the Right Number of Threads
27:55 Live Coding: Dealing with Exceptions with Timeouts
29:41 Live Coding: Setting up Timeout to Unlock a Producer / Consumer
30:55 Live Coding: Creating a Cache with a Race Condition on HashMap
32:52 Live Coding: Fixing the HashMap Cache with ReadWriteLock
34:51 Live Coding Wrap-up
35:58 Module Wrap-up
CHECK OUT OUR OTHER VIDEOS
Advanced Multithreading Java Concept - Part 1 #ExecutorPattern, #Futures and #Callable
Now we have two ways of synchronizing in the Java language, the synchronized keyword that can be used in several ways and the volatile keyword that we can use on failed declarations.
Those two keywords are related to what is called intrinsic locking. There is also explicit locking, and this is what we are going to see first mainly based on the use of a lock interface.
Then, we will see that using this lock interface and the condition interface we can implement the wait/notify pattern in a different and more powerful way. And then, we will see what's semaphores are. Semaphores are not a new concept in Java. It is a concept that comes from operating system and that is implemented in other languages. We will see the Java flavor of semaphores.
TIMESTAMPS
0:00 Module Agenda
1:05 What Is Wrong with Intrinsic Locking and Synchronization?
2:38 Introducing API Locking with the Lock Interface
3:59 Differences Between Synchronization and API Locking
4:37 Lock Patterns: Interruptible Lock Acquisition
5:34 Lock Patterns: Timed Lock Acquisition
6:16 Lock Patterns: Fair Lock Acquisition
7:29 Wrapping-up the Lock Pattern
8:15 Producer / Consumer Pattern: Wait / Notify Implementation
9:52 Producer / Consumer Pattern: Lock Implementation with Condition
11:15 The Condition Object: Interruptibility and Fairness
12:56 Wrapping-up the Lock and Condition Objects
13:17 Introducing the ReadWriteLock Pattern
14:49 Implementing an Efficient Concurrent Cache with ReadWriteLock
16:04 Wrapping-up the ReadWriteLock Pattern
16:47 Introducing the Semaphore Pattern, First Example
18:27 Semaphore Pattern: Interruptibility and Timed Permit Acquisition
19:39 Wrapping-up the Semaphore Pattern, Control of the Waiting Threads
20:54 Live Coding: Producer / Consumer Based on the Lock Pattern
23:22 Live Coding: Setting up Conditions on the Producer / Consumer
26:07 Live Coding: Setting up the Right Number of Threads
27:55 Live Coding: Dealing with Exceptions with Timeouts
29:41 Live Coding: Setting up Timeout to Unlock a Producer / Consumer
30:55 Live Coding: Creating a Cache with a Race Condition on HashMap
32:52 Live Coding: Fixing the HashMap Cache with ReadWriteLock
34:51 Live Coding Wrap-up
35:58 Module Wrap-up
CHECK OUT OUR OTHER VIDEOS
Advanced Multithreading Java Concept - Part 1 #ExecutorPattern, #Futures and #Callable