Chapter 7. Using Concurrent and Parallel Processing

In this chapter, we will cover the following recipes:

  • Implementing optimistic concurrency
  • Managing parallel contexts
  • Handling data retrieval in highly-threaded environments
  • Attaching objects with unit of work
  • Improving multiple context performance

Introduction

When working with modern computers, there has been a transition on both the technology and the user experience that will drastically affect our applications. The technology has progressed to a point that microprocessor manufacturers can no longer make processors that are faster and smaller, but have shifted their focus to providing multiple cores on each chip. This shift does not automatically give performance increases to the applications running across the chip. Taking advantage of this takes some forethought and a different approach to the application development. We now want to focus on taking advantage of the time spent waiting on a processor. If we can reduce the amount of time that we spend waiting on something to complete, and use that time for other activities, then we will be able to create overall increase in the performance of the applications that we write.

The other major shift that we have to be aware of is that our users are becoming ever more technologically savvy. They are used to working with applications and websites that are fast, responsive, and user-friendly. This causes them to have higher expectations when they use our applications. We can help meet these expectations by making sure that all the work that will take an unacceptable amount of time is back grounded, and the application stays responsive during that work completion. We can also take advantage of the user's familiarity to the advanced systems, to show the notifications of this background work completion, without confusing most users.

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

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