8
            
            votes
        
            
                
                Accepted
            
        
        TimeProvider.Delay as a unit test friendly alternative to Task.Delay
                    You don't need this at all. The Task.Delay has overloads which anticipates a TimeProvider (for example: ...
                
            
       
        
            
                7
            
            votes
        
        
            
            
        A TaskScheduler that always run tasks in a specific thread
                    I had a similar problem. Here is an easy way to make all your tasks run exclusively on one thread for all tasks. And you can also run the them Concurrently to using ...
                
            
       
        
            
                6
            
            votes
        
            
                
                Accepted
            
        
            
            
        ForEachAsync extension method (a way to run an async operation on each item of a sequence in parallel)
                    Rather than writing something custom, you could use the TLP Dataflow library.
...
                
            
       
        
            
                6
            
            votes
        
        
            
        TaskScheduler that uses a dedicated thread
                    Dispose the scheduler gracefully
As you mentioned, you lack proper disposal functionality.
...
                
            
       
        
            
                6
            
            votes
        
            
                
                Accepted
            
        
            
        Usage of TPL vs Parallel.ForEach() on file processing
                    As seen with @t3chb0t and @dfhwze I have been misusing the TPL. I also don't see any point on .ConfigureAwait(false) a ...
                
            
       
        
            
                6
            
            votes
        
        
            
            
        
            
                5
            
            votes
        
        
            
            
        SemaphoreSlim extension method for safely handling cancellation and disposal
                    Review
Is there a better way to safely manage the cancellation and disposal of SemaphoreSlim instances?
You've made a pattern to safely manage completing / aborting a task that is acquiring or has ...
                
            
       
        
            
                4
            
            votes
        
            
                
                Accepted
            
        
            
        Are there pitfalls to this solution to read messages from a queue in parallel?
                    Readability  
Use keyword var any time that the initialization of the variable clearly tells what the variable represents. Avoid abbreviations in variable names.
<...
                
            
       
        
            
                4
            
            votes
        
            
                
                Accepted
            
        
            
            
        Throttled execution of an enumeration of Tasks
                    A TPL inside async implementation: mixing of implementaion concepts makes the code complicated or even buggy. Finally ...
                
            
       
        
            
                4
            
            votes
        
            
                
                Accepted
            
        
        Extension methods to modify an async Task's type from Task<IEnumerable<T>> to Task<List<T>>
                    Just two points to mention
you should add documentation to the second method as well, because it is a public method and you have documented the first method as ...
                
            
       
        
            
                4
            
            votes
        
            
                
                Accepted
            
        
            
            
        Implement DRY principle with IAsyncDisposable
                    I read your code three times and quite frankly it does not make too much sense for me.
(Maybe I'm just tired, but still it doesn't ...)
You have implemented the disposable pattern where your are not ...
                
            
       
        
            
                3
            
            votes
        
        
        Async/Await Computation Expression
                    This is a nice idea, and I'm only going to comment on some of the generic bits of the F#:
...
                
            
       
        
            
                3
            
            votes
        
            
                
                Accepted
            
        
            
        parallel bing maps searching
                    I would suggest using the Bing Maps JSON Data Contract classes to deserialize the response:
...
                
            
       
        
            
                3
            
            votes
        
        
            
        parallel bing maps searching
                    You forgot to remove the _consoleLock. It's not used anymore. I assume it has been replaced by the reportLocker which has a ...
                
            
       
        
            
                3
            
            votes
        
            
                
                Accepted
            
        
            
        Parsing NuGet packages.config with Parallel.ForEach
                    If you want to do it this way then you need a lock but since the rest of your code is using Linq I would suggest you convert it over to PLINQ instead of using ...
                
            
       
        
            
                3
            
            votes
        
        
            
        Repeating a task that may fail (in parallel)
                    Concurrency
  Is this parallel implementation correct?
I would expect a method called RunParallel<T> to use processor affinity (Parallel.For) specially since ...
                
            
       
        
            
                3
            
            votes
        
        
            
        Asynchronous wrapper for database connection
                    I would first start by saying that such a class is generally regarded as a bad practice because it doesn't achieve what's supposed to do, or simply there are better ways of doing it.
But let's go to ...
                
            
       
        
            
                3
            
            votes
        
        
            
        Parallel FTP client
                    In ListNonArchiveDirectoresWithFiles Method, once you get the finishedTaskIndex you can choose to simply use  ...
                
            
       
        
            
                3
            
            votes
        
        
            
        Parallel FTP client
                    While continuing work on this code I have noticed that ListNonArchiveDirectoresWithFiles() already collects all the data retrieved by ...
                
            
       
        
            
                3
            
            votes
        
        
            
        Async concurrency prevention class
                    Foreword
I appreciate you taking the effort to edit your question time and again to clarify your goal. At first, I thought you were making a synchronous task scheduler using whatever thread is ...
                
            
       
        
            
                3
            
            votes
        
        
            
        Iterate through Expression Tree
                    Just some thoughts:
Not sure why you don't just flatten the expression tree with a visitor and then return the collection of expressions. This leads to simpler code:
...
                
            
       
        
            
                3
            
            votes
        
            
                
                Accepted
            
        
            
            
        Creating an app to simulate load
                    There are several improvement areas. Let's review them one-by-one from bottom up:
GetXYZ
...
                
            
       
        
            
                3
            
            votes
        
        
            
            
        Creating an app to simulate load
                    Overall, the code is quite clean and easy to understand. You did a good job of subdividing the work into small and easily digestible submethods.
I did notice a few other things though, which I'll list ...
                
            
       
        
            
                3
            
            votes
        
            
                
                Accepted
            
        
            
            
        Updating items in a list from a blocking source asynchronously
                    My try to simplify and prettify the method.
Avoid using globals in async code, pass Token as argument.
...
                
            
       
        
            
                3
            
            votes
        
        
            
        Parallel Calls to External WCF Service - ASP.NET Web Api
                    I think instead of creating an unknown amount of task using PLinq would make it simpler and have control over the number of task inflight/created
something like
...
                
            
       
        
            
                3
            
            votes
        
        
            
        Extension methods to modify an async Task's type from Task<IEnumerable<T>> to Task<List<T>>
                    I think you can implement the AsListAsync as a one-liner
...
                
            
       
        
            
                2
            
            votes
        
        
            
            
        A TaskScheduler that always run tasks in a specific thread
                    Building on user161231's code (thanks!), here is a complete answer that uses modern .NET framework objects. Sorry it's not strictly a code review (although for me a code review that removes code and ...
                
            
       
        
            
                2
            
            votes
        
        
        Websockets client code and making it production-ready
                    The wrapper sends and receives exactly one message before closing the connection. If you're just doing that, you can simply use HTTP. WebSockets is useful when there is a sequences of reads and/or ...
                
            
       
        Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
task-parallel-library × 151c# × 148
async-await × 38
multithreading × 25
.net × 22
asynchronous × 22
concurrency × 11
performance × 10
thread-safety × 8
producer-consumer × 5
tpl-dataflow × 5
error-handling × 4
wpf × 4
tcp × 4
beginner × 3
comparative-review × 3
iterator × 3
f# × 3
timer × 3
.net-core × 3
linq × 2
http × 2
queue × 2
networking × 2
winforms × 2