Will Reactive Extensions (Rx) supersede the Task Parallel Library?

Posted on

Problem :

After following through the samples of Rx.NET, I’m gob smacked at how brilliant the concept and implementation of Reactive Extensions are. It appears to offer developers a more maintainable pattern for achieving the same sort of multi-threaded parallel coding that .NET 4.0’s task parallel library offers.

Will Rx.NET supersede TPL? Should it?

Solution :

In short, no.

The Task Parallel Library (TPL) provides provides distribution of work (concurrency), as well as the concurrent optimisation of larger work (parallelism) while abstracting the actual mechanism of work distribution (threads).

C# adds the async keyword to help manage asynchrony from a language level. Rx has already been updated to support this feature.

Rx provides a framework to compose and manage asynchronous data streams using standard operators. While there is some crossover in Rx’s use of schedulers, this is only an abstraction. In fact, the recommended scheduler for parallelism is the TaskScheduler, which uses the TPL.

See also Jeffrey van Gogh’s response to the exact opposite question on the Rx forums.

Also, this question may be of use.

Leave a Reply

Your email address will not be published. Required fields are marked *