Implementing Concurrency Patterns

In Chapter 11, Implementing Reactive Design Patterns, we discussed the Reactive Design Pattern and how it fulfills the requirements of today's applications. Spring 5 Framework has introduced the Reactive Web Application Modules for the web application. In this chapter, we will explore some of the Concurrency Design Patterns and how these patterns solve the common problems of the multithreaded application. Spring 5 Framework's reactive modules also provide the solution for the multithreaded application.

If you are a software engineer or are in the process of becoming one, you must be aware of the term concurrency. In geometric properties, concurrent circles or shapes are those shapes that have a common center point. These shapes can differ in dimensions but have a common center or midpoint.

The concept is similar in terms of software programming as well. The term concurrent programming in the technical or programming means the ability of a program to carry out multiple computations in parallel and also the capability of a program to handle multiple external activities taking place in a single time interval.

As we are talking in terms of software engineering and programming, concurrency patterns are those design patterns that help in dealing with multi-threaded programming models. Some of the concurrency patterns are as follows:

  • Handling concurrency with concurrency patterns
  • Active object pattern
  • Monitor object pattern
  • Half-Sync/Half-Async patterns
  • Leader/followers pattern
  • Thread-specific storage
  • Reactor pattern
  • Best practices for concurrency module

Let's now explore each of these five concurrency design patterns in depth.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset