Home » Tag Archives: Concurrency

Tag Archives: Concurrency

The Java Syncrhonisers

java-logo

Threads communication happens primarily by sharing access to fields and objects. Although extremely efficient, this form of communication is prone to errors such as thread interference and memory consistency. Synchronization is a tool that helps to prevent such errors. However, synchronization does not come for free and can introduce latency when accessing a lock or object that is currently being ...

Read More »

Remembering to Reset Thread Context Class Loader

java-logo

I’m having a difficult time thinking of anything I like less about working with Java than working with class loaders. This is particularly true when working with application servers or OSGi where the use of multiple class loaders is prevalent and the ability to use class loaders transparently is reduced. I agree with the OSGI Alliance Blog post What You ...

Read More »

A Beginner’s Guide to Addressing Concurrency Issues

software-development-2-logo

Inserts, updates and deletes. Every framework tutorial starts with these and they are seen as the most basic functionality that just works. But what if two concurrent requests try to modify the same data? Or try to insert the same data that should be unique? Or the inserts and updates have side-effects that have to be stored in other tables ...

Read More »

Scalable I/O: Events- Vs Multithreading-based

software-development-2-logo

Everything begins with a refresher reading of my fundamental papers – yes, I use a set of papers and books as reference material. This paper is titled: “Why Events Are A Bad Idea (for high-concurrency servers)“, by Rob von Behren at the time of writing a PhD fellow at Berkeley [18]. Von Behren opens with: “Event-based programming has been highly touted ...

Read More »

If Java Were Designed Today: The Synchronizable Interface

java-logo

Java has come a long way. A very long way. And it carries with it all the “junk” from early day design decisions. One thing that has been regretted time and again is the fact that every object (potentially) contains a monitor. This is hardly ever necessary and this flaw was corrected, finally, in Java 5, when new concurrency APIs ...

Read More »

The importance of tuning your thread pools

java-logo

Whether you know it or not, your Java web application is most likely using a thread pool to handle incoming requests. This is an implementation detail that many overlook, but sooner or later you will need to understand how the pool is used, and how to correctly tune it for your application. This article aims to explain the threaded model, ...

Read More »

Testing multithreaded code in Java

java-logo

Testing multithreaded code is a tough challenge. The first advice that you get when trying to test concurrency is to isolate your concurrent concerns in the code as much as possible. This a general design advice but in this case it’s even more important. Make sure to first properly unit test the logic that is wrapped by the concurrent construct. ...

Read More »

OpenMap Tutorial – Part 1

java-logo

Introduction This series of tutorials will show you how to build Java applications using the OpenMap GIS Java Swing library. OpenMap’s Developer guide is a very useful document that describes OpenMap’s architecture but it doesn’t explain how to start and build up an application step-by-step. The examples that come together with the source code are useful but not enough. OpenMap ...

Read More »

Testing Asynchronous Code

scala-logo

Asynchronous code is hard. Everyone knows that. Writing asynchronous tests is even harder. Recently I fixed a flaky test and I want to share some thoughts about writing asynchronous tests. In this post we explore a common problem with asynchronous tests—how to force a test to take a specific ordering between threads, and forcing some operations by some threads to ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials