concept responsiveness in category .net

appears as: responsiveness, responsiveness
Concurrency in .NET

This is an excerpt from Manning's book Concurrency in .NET.

Concurrency describes the ability to run several programs or multiple parts of a program at the same time. In computer programming, using concurrency within an application provides actual multitasking, dividing the application into multiple and independent processes that run at the same time (concurrently) in different threads. This can happen either in a single CPU core or in parallel, if multiple CPU cores are available. The throughput (the rate at which the CPU processes a computation) and responsiveness of the program can be improved through the asynchronous or parallel execution of a task. An application that streams video content is concurrent, for example, because it simultaneously reads the digital data from the network, decompresses it, and updates its presentation onscreen.

Backpressure occurs when a computer system can’t process the incoming data fast enough, so it starts to buffer the arriving data until the space to buffer it is reduced to the point of deteriorating the responsiveness of the system or, worse, raising an “Out Of Memory” exception. In the case of iterating over the items in an IEnumerable, the consumer of the items is “pulling”; the items are processed at a controlled pace. With IObservable, the items are “pushed” to the consumer. In this case, IObservable could potentially produce values more rapidly than the subscribed observers can handle. This scenario generates excessive backpressure, causing strain on the system. To ease backpressure, Rx provides operators such as Throttleand Buffer.

Figure 6.11 Backpressure could negatively affect the responsiveness of a system, but it’s possible to reduce the rate of the incoming events and keep the system healthy by using the throttle function to manage the different rates between an observable and an observer.

c06-11.png