Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

High-level multithreading/concurrency abstractions for .NET

I just wondered why, unlike Scala, F# or Haskell, the basic .NET framework (as available in C# or VB) seems to have very little native support for higher level concurrency patterns.

There are basic mechanisms available - locks, monitors, the thread pool - but what about

  • Synchronized variables (MVar)
  • Synchronous channels
  • Asynchronous channels (see Go or Haskell)
  • Actors / message passing (Erlang-Style)
  • Futures
  • Parallel computations/List functions
  • Composable asynchronous computations through Linq (like F#'s async {})

or even software transactional memory (STM for Haskell)

And even taken account of ParallelFX, this list is only partially covered.

Are there certain deeper reasons against providing such functionalities (and instead wanting people to mess around with IAsyncResult's) or is this planned to be integrated in future?

like image 282
Dario Avatar asked Nov 17 '09 19:11

Dario


2 Answers

There's active and ongoing research into the best and most effective abstractions that can be used to enable concurrent software without mastering the minutiae b/c most dev's either don't have the time or inclination to develop their skills to that level.

Given this, the BCL has a fairly high barrier to entry for new concepts, but that doesn't mean that they aren't happening. Most recently, in .Net 4, there will be the introduction of the Task Parallel Library. Earlier versions of the TPL actually included a Future<T> type that has since been supplanted by newer abstractions.

There's also active research going on in the arena of channels/etc via the research language Axum.

I'm obviously not part of the team and I don't work for Microsoft, but my understanding is that there's a desire to innovate in this area beyond what's already widely available.

like image 120
Greg D Avatar answered Sep 28 '22 04:09

Greg D


I agree with Greg D, there is a lot of "stuff" coming. MS with the new .Net4 framework and their Axum project. The problem that I see with all those approaches is that they get extremely complicated and that skills, knowledge and experience in the areas of distributed/parallel/distributed computing is rather "limited". I don't write that to offend anybody, but I reckon that universities and educators in general have to pay more attention to these topics. But, what I think and hope is that the mainstream awareness that MS creates with implementing many of these ideas, Axum, CCR&DSS, Asynchronous Agents Library etc. and the general trend/need towards multi-core / cloud computer system, that we will see more soon :)

like image 38
alex25 Avatar answered Sep 28 '22 02:09

alex25