9

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?

Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
Mark
  • 9,320
  • 6
  • 57
  • 70

1 Answers1

16

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.

Community
  • 1
  • 1
Richard Szalay
  • 83,269
  • 19
  • 178
  • 237
  • TPL isn't about parallelism, it's about concurrency. – user Sep 25 '12 at 09:53
  • 1
    @user - True, though PLINQ is part of TPL and it provides parallelism. – Richard Szalay Sep 25 '12 at 10:32
  • 3
    You must see the irony of that comment "Task Parallel Library isn't about Parallelism" ;-) – Lee Campbell Oct 12 '12 at 11:44
  • Old question but I don't think I can agree with this answer's premises (though the outcome is a different matter). For me, asynchrony is about generation of observables, and tasks can be considered observables too. So Rx is a different conceptual framework that offers a different terminology that encompasses everything TPL + async involves. – Sentinel Oct 26 '18 at 06:39