开发者

High-level multithreading/concurrency abstractions for .NET

开发者 https://www.devze.com 2022-12-12 05:58 出处:网络
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.

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, monit开发者_开发问答ors, 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?


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.


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 :)

0

精彩评论

暂无评论...
验证码 换一张
取 消