Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 943
Mark Avatar asked Nov 05 '10 10:11

Mark


1 Answers

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.

like image 184
Richard Szalay Avatar answered Sep 28 '22 06:09

Richard Szalay