Posts

From DIP to DIC. Almost complete but naive.

DIP (Dependency Inversion Principle)         IoC (Inversion of Control)                 Interface Inversion                 Flow Inversion                 etc.                 CI (Creation Inversion)                         Factory patterns                         Service Locater pattern                       ...

.NET Deadlock samples collection

I will try to combine .NET Deadlock samples here. Hope it would be profitable for me. By a SynchronisationContext TPL and async/await Best Practices for the Busy Developer

JavaScript Revealing Prototype Pattern - Error Prone Point

The pattern has a unsafe context switching. It can make you pain. Look at JSFiddle Revealing Prototype Pattern error prone point Think twice before use it. Revealing Module Pattern is cool (and  FFE ).

Asynchronous Programming Concepts (.NET related)

Async execution - It's all about responsiveness. Old code scenarios To use WaitHandle from a Task. Implement the APM pattern by FromAsync methods and "Tasks Forest" Implement the EPM pattern by TaskCompletionSource. Asynchronous Task means the Threadless Task. Asynchronous Tasks may have only the next statuses: Fault, RunToCompletion, Cancelled. Continuation for Asynchronous Tasks Use the TaskCompletionSource<T> class. async await A syntactic sugar for awful amount of work. A compiler's underground job. A enumeration, try, finally, using and etc. Users SynchronizationContext implicitly. Unwrap multiple exceptions The await will return only the first exception from a AggregateException. There is a useful trick to unwrap multiple exceptions. await task.ContinueWith(     ( ) => { } ,     TaskContinuationOptions. ExecuteSynchronously ); var results = task .Result; Multiple await Preventing of lost exceptions wit...

Concurrent Programming

Asynchronous Programming Parallel Programming Multithreaded Programming

Parallel Programming Concepts (.NET related)

Parallel execution - It's all about loaded computations. Common Types of Parallelism Data     amount of data processed by one operation in parallel. Patterns     Parallel Loops Implementations     Parallel.Foreach     Parallel.For Task     Some data or amount of data processed by many operations. Patterns     Parallel tasks Implementations     Parallel.Invoke Dataflow     Operations processed in some flow or order. Patterns     Features     Pipeline Embarrassingly parallel     computations entirely independent of one another. No dataflow in between the options. Patterns Parallel Loops Parallel.For / Parallel.Foreach Parallel Tasks Parallel.Invoke Parallel Aggregation Map- Reduce Producer-Consumer By Parallel Loops with TLS (Task Local Storage) parameter or by Wait All One By One Futures Dynamic Task Parallelism Pipelines + Concurrent D...

Multithreaded Programming

Synchronization primitives Semaphore Slim