Start learning now
You've reached Level 26
You've reached Level 26
Comparator, sorting collections
"Hi, Amigo!" "Hi, Bilaabo!" "Today we'll examine a small, but interesting and useful topic: sorting collections." "Sorting? I've heard something about that." "Long ago, every programmer had to be able to write sorting algorithms. Had to be able to and had to write them. But those days are over. Today, writing your own sorting code is considered bad form, just like rewriting anything else that has already been invented ..."
Practice with sorting and using Comparator
Shared resources, conflicts, shared access
"Hi, Amigo! I want to tell you about sharing resources. Across different threads, naturally. "I keep talking about the problems that happen when working with multiple threads and how to solve them. This doesn't mean that using threads is bad. Threads are a very powerful tool. In fact, they let you make your program faster and even more reliable. The more complex a program is, the more threads and various ..."
"Hi, Amigo!" "Hi, Ellie!" "I want to tell you about the volatile modifier. Do you know what that is?" "Something to do with threads. I don't remember exactly.""Then listen up. Here are some technical details for you:""A computer has two types of memory: global (ordinary) memory and memory built into the processor. The built-in processor memory is divided into registers, a first-level cache (L1), second-level cache (L2) ..."
Practice using volatile
Mutex and monitor
"Hi, Amigo!" "In my previous lessons, I sometimes used the words 'mutex' and 'monitor', now it's time to tell you what they mean." "I'm all ears." "A mutex is a special object for synchronizing threads/processes. It has two possible states: busy and free. Simplying things, a mutex is a boolean variable that can have two values: busy (true) and free (false) ..."
"Hi, Amigo!" "Yes, I'm here, I'm here." "Today, I will tell you about using synchronized in practice." "When a program has many objects and threads, it often happens that multiple threads work with the same object simultaneously. In doing so, the threads interfere with each other." "Yes, I already know this." "So, let's say you have an object being accessed by multiple threads ...."
Difficult tasks using synchronized
Concurrency, BlockingQueues (Java 7)
"Hi, Amigo!" "Hi, Kim!" "Today, I'm going to tell you about concurrency." "Concurrency is a Java class library that includes special classes that have been optimized for work from multiple threads. This is a very interesting and extensive topic. But today we're just going to get an introduction. The package is called java.util.concurrent package. I'll tell you about a couple of interesting classes ..."
Practice with concurrency
Learning to google | Level 6 | Lesson 11
"Hi, Amigo!" "Let's continue our lessons on how to google." "Here are some exercises ..:"