Java Concurrency : Part 2 – Manipulate Threads

Java Logo
This entry is part 1 of 7 in the series Java Concurrency Tutorial

This entry is part 1 of 7 in the series Java Concurrency TutorialAfter seeing how to create Threads, we’ll see in this article what we can do to manipulate Threads. When we’ve Threads, we can make several operations on the Threads : Make the current Thread sleeping during x milliseconds Wait for an other thread [...]



Java Concurrency – Part 1 : Threads

Java Logo
This entry is part 2 of 7 in the series Java Concurrency Tutorial

This entry is part 2 of 7 in the series Java Concurrency TutorialThis post is the first of set of posts about Java Concurrency. The concurrency is the fact to made several things at the same time using several threads. A thread, also called Lightweight Process, is treatment unity. Threads executes code in parallel of [...]



Java Concurrency – Part 4 : Semaphores

Duke Cowboy Java
This entry is part 2 of 7 in the series Java Concurrency Tutorial

This entry is part 2 of 7 in the series Java Concurrency TutorialWe continue in Java Concurrency with the semaphores. Semaphores is also a way to synchronize threads. Semaphores are a really simple concept, invented by the famous Dutch computer scientist Edsger Dijkstra. Basically a semaphore is a counter (integer) that allows a thread to [...]



Java Concurrency – Part 3 : Synchronization with intrinsic locks

Java Logo
This entry is part 3 of 7 in the series Java Concurrency Tutorial

This entry is part 3 of 7 in the series Java Concurrency TutorialAfter learning how to create threads and manipulate them, it’s time to go to most important things : synchronization. Synchronization is a way to make some code thread safe. A code that can be accessed by multiple threads must be made thread safe. [...]



Java Concurrency – Part 5 : Monitors (Locks and Conditions)

Duke Cowboy Java
This entry is part 4 of 7 in the series Java Concurrency Tutorial

This entry is part 4 of 7 in the series Java Concurrency TutorialAfter seeing how to synchronize code using semaphores, we’ll see how to do that using monitors. Monitors are an other mechanism of concurrent programming. It’s a higher level mechanism than semaphores and also more powerful. A monitor is an instance of a class [...]



Java Concurrency – Part 6 : Atomic Variables

Duke Cowboy Java
This entry is part 5 of 7 in the series Java Concurrency Tutorial

This entry is part 5 of 7 in the series Java Concurrency TutorialWhen a data (typically a variable) can be accessed by several threads, you must synchronize the access to the data to ensure visibility and correctness. By example, if you have a simple counter (yes, once again) : This class works really well in [...]



Java Concurrency – Part 7 : Executors and thread pools

Duke Cowboy Java
This entry is part 6 of 7 in the series Java Concurrency Tutorial

This entry is part 6 of 7 in the series Java Concurrency TutorialLet’s start with a new post in the Java concurrency series. This time we’ll learn how to start cleanly new threads and to manage thread pools. In Java, if you have a Runnable like this : You can easily run it in a [...]