11

The Task Parallels Extras extension was published in 2010, and since then no updates have been released.

I published this code as a DLL on Nuget 3 years ago and it has had over 16,000 downloads, which is an indicator of interest in the code.

Have the TPL Extras been superseded by any newer technology? If so, I would like to annotate the Nuget description appropriately.

makerofthings7
  • 60,103
  • 53
  • 215
  • 448
  • 2
    There still are some pearls in there. Also bugs. This project would very much benefit from open sourcing it. Stephen Toub is the author of it. I'm not aware of his or Microsoft stance on open sourcing it. – usr May 28 '16 at 14:05
  • @Usr is it open source, just check the links provided. I personally compiled the code and placed it on NuGet – makerofthings7 May 28 '16 at 16:59
  • Yes, I saw your package. I don't trust unknown people to put executable code on my machine and onto my production servers, though. ParallelExtensions needs an official NuGet source. – usr May 28 '16 at 17:52
  • 1
    There are various forks of it on the web. I maintain my own fork which fixes severe bugs. There should to be an official GitHub repo that collects all improvements that various people have made. – usr May 28 '16 at 17:54
  • I agree it needs an official source, but the open source code is here. https://code.msdn.microsoft.com/Samples-for-Parallel-b4b76364/view/SourceCode#content – makerofthings7 May 28 '16 at 17:55
  • Confused now when you say "it needs to be open source" and "there are forks"... – makerofthings7 May 28 '16 at 17:55
  • Right, I chose the wrong word when I complained about "open source". It is open source right now. I meant that it needs an official (NuGet) release, a central GitHub repo and a maintainer. Did you consider contacting Stephen Toub and asking for permission to organize such a thing? You seem to be interested in helping out here. – usr May 28 '16 at 17:57
  • I looked for his twitter but didn't see a easy way to find him. I figured posting this would eventually get to him... – makerofthings7 May 28 '16 at 17:58
  • 2
    It was moved to GitHub and updated for .Net Standard 2.1! https://github.com/dotnet/samples/tree/master/csharp/parallel/ParallelExtensionsExtras – VoteCoffee May 14 '20 at 20:01
  • 2
    https://learn.microsoft.com/en-us/samples/dotnet/samples/parallel-programming-extensions-extras-cs/ – VoteCoffee May 14 '20 at 20:01

2 Answers2

5

There is no single technology that supersedes PEE, but there are some that make some parts of it less useful or obsolete:

  1. async-await makes LINQ to Tasks pretty much obsolete
  2. Rx contains Task.ToObservable() extension method (and apparently already did when the article was published)
  3. ConcurrentExclusiveSchedulerPair introduced in .Net 4.5 is an improved version of ConcurrentExclusiveInterleave
  4. TPL Dataflow can be used to implement a pipeline
  5. Most networking types were extended with async methods in .Net 4.5
svick
  • 236,525
  • 50
  • 385
  • 514
  • 3
    `ConcurrentExclusiveSchedulerPair` also replaces `LimitedConcurrencyLevelTaskScheduler `. – Stephen Cleary May 28 '16 at 15:06
  • @StephenCleary Do you know if there is a replacement for `QueuedTaskScheduler`? We are trying to port some code forward and we've got a project dependent on that class. Can't seem to find what would replace it – pinkfloydx33 Apr 21 '18 at 14:19
  • @pinkfloydx33: There is not AFAIK. `QueuedTaskScheduler` does a **lot**. You'd need to determine which aspects you need (task priorities / fairness / foreground threads / apartment state / thread priorities / thread init & teardown / thread stack size / nested task schedulers), and see if you can rewrite the code to not require those aspects. (I didn't list the concurrency aspect as that is included `ConcurrentExclusiveSchedulerPair`). – Stephen Cleary Apr 21 '18 at 17:10
  • @StephenCleary I just found this StackOverflow question after some digging when attempting to find out if StaTaskScheduler from the PEE, which I need, has been superseded; would you happen to know if it has and if so, with what? A list of everything from the PEE and how its various extensions were superseded would be so nice to have! Note though that the latter question is just wishful thinking, the former is what I really want. :) Thanks! – Geoff Oct 18 '19 at 03:51
  • @StephenCleary I can't edit my previous comment now after rereading it (it was late when I wrote it, heh), my main question though is if you know of whether anything has superseded StaTaskScheduler. Sorry if I confused things with my enthusiasm at the end there! – Geoff Oct 18 '19 at 17:03
  • @Geoff: `I can't edit my previous comment now` - been there myself! As far as task schedulers go, `ConcurrentExclusiveSchedulerPair` is the only thing influenced by PEE that's made it into the framework. You can make a single-threaded scheduler from it (by only using the `Concurrent` one), but there's no STA pumping provided. :/ I'm not sure where .NET Core stands with STA support at all, actually. Sorry! – Stephen Cleary Oct 19 '19 at 13:45
  • @StephenCleary No worries, thanks anyway! After further digging, as you rightly point out, what the StaTaskScheduler is missing is message pumping, so I'm currently working on integrating the MessageLoopApartment class from https://stackoverflow.com/a/22262976/186524 instead. :) – Geoff Oct 23 '19 at 21:38
0

Not sure if you're still collecting feedback on this, but figured I'd chip in anyway.

As far as I can tell, the Parallel Extras extension is still the only official-ish Microsoft library that implements an observable dictionary (ObservableConcurrentDictionary), which I know I've looked for in the past, and it seems others have as well (.NET ObservableDictionary)