A software engineering blog mainly focused on programming, web development and testing

Posts

  • Java Concurrency Tutorial – Thread-safe designs

    After reviewing what the main risks are when dealing with concurrent programs (like atomicity or visibility), we will go through some class designs that will help us prevent the aforementioned bugs. Some of these designs result in the construction of thread-safe concurrency solutions. This will allow us to share objects safely between threads. As...

  • Java Concurrency Tutorial – Visibility between threads

    When sharing an object’s state between different threads, other issues besides atomicity come into play. One of them is visibility between threads.

    The key fact is that without synchronization, instructions are not guaranteed to be executed in the order in which they appear in your source code. This won’t affect the result in a single-threaded program but,...

  • Java Concurrency Tutorial – Atomicity and race conditions

    Atomicity and race conditions is one of the key concepts in multi-threaded programs. We say a set of actions is atomic if they all execute as a single operation, in an indivisible manner. Taking for granted that a set of actions in a multi-threaded program will be executed serially may lead to incorrect results. The reason is due to thread...

  • Spring Integration – Configure web service client timeout

    With the support of Spring Integration, your application can invoke a web service by using an outbound web service gateway. The invocation is handled by this gateway. Hence, you just need to worry about building the request message and handling the response. However, with this approach it is not obvious how to configure additional options like setting timeouts or caching...