concept concurrency in category spring

appears as: Concurrency, concurrency
Spring Integration in Action

This is an excerpt from Manning's book Spring Integration in Action.

After issuing an asynchronous request, you have two components that execute independently: the requester that continues doing its work and the service provider whose work is deferred until later. Concurrency is a powerful tool for increasing the application performance, but it adds complexity to your application too. You have to consider concerns like thread--safety, proper resource management, deadlock, and starvation avoidance. Also, at runtime, it’s harder to trace or debug a concurrent application. Finally, the two concurrent operations will typically end up executing in distinct transactions. Synchronous and asynchronous communication are compared in more detail in table 2.1.

Dynamic configuration requires shifting focus from the logic of the application to the expected behavior at runtime. Configuring runtime behavior involves controlling the schedule of various timed events in the application, such as the frequency with which external message sources are polled, and also configuring various parts of the application to run concurrently, making optimal use of system resources, and increasing the rate at which messages are being processed. You learn to manage scheduling and concurrency in this chapter.

Enterprise applications can increase their performance and responsiveness by executing concurrent operations. Concurrency may be a requirement. For example, the application may be required to be able to handle multiple incoming requests at once. It could also be a way of taking advantage of the capabilities of the hardware, especially since multicore and multiprocessor systems have become mainstream. In either case, the problem of creating an application that executes tasks in parallel can be split into two parts, with orthogonal concerns.

Dependency Injection: Design Patterns Using Spring and Guice

This is an excerpt from Manning's book Dependency Injection: Design Patterns Using Spring and Guice.

1 Find out more at http://jcip.net. Chapter 9 has a lot of detailed information on concurrency and good class and object design. Jump ahead if you are curious.

9.3. Objects and concurrency

Concurrency is increasingly a very important aspect of modern applications. As we scale to higher levels of traffic and demand, there’s a greater need for multiple concurrent threads of execution. Thus, the role of objects managed by the dependency injector is extremely important. Singletons are a particularly significant example of this need.