Double Checked Locking in Java

You may wonder if double checked locking (DCL) works in Java. It does and it doesn’t. I explain why. Continue reading Double Checked Locking in Java

Advertisements

Simple Animation Loop in Java

If you want to show some animation, maybe for a simple java game, then you need to render a certain amount of frames per second. For a smooth animation you want 30 to 60 frames per second. But sometimes the needed calculations need a bit longer so the delay until the drawing of the next frame needs to be shorter. For this an animation loop is needed. I have implemented a very simple animation loop for Java 8+ that can be paused and started.

Continue reading Simple Animation Loop in Java