MultiThreadingProtectorAspect<T, TResult>

Hi, today I would like to share with you another aspect for protection service method in multi-threading environment. I also try to examine how fast this solution is and how much of the CPU time it consumes. Todays implementation is extended for most popular usage and it is a method that return value and it is still protected. I will try to show you a test program that will be a kind of console application invoker. This Continue ReadingMultiThreadingProtectorAspect<T, TResult>

MultiThreadingProtectorAspect<T>

Hi, Have you ever wants to protect your method against many concurrent thread in multi-threading environment? Let’s say you have WCF service implementation and in that implementation best practice is create static class with static methods because of performance (static is about 40% faster than non-static). Oh right and let’s say that you need to access to for example file store in that file something or you have field that should be protect or you can simply Continue ReadingMultiThreadingProtectorAspect<T>

ForeachREST in WCF Generic Implementation

Hi, do you remember my previous post about Foreach in WCF? Today I would like to show you only code samples of the same problem but with REST technology because I search the Internet and there is no example of both Server and Client sites setup property in .NET 4.0. Very often you can find implementation with the HttpClient class that is waste of time in my opinion. I will present you project stored in tree assemblies Continue ReadingForeachREST in WCF Generic Implementation

Foreach in WCF Generic Implementation (New)

Hi, Today I try to resolve in elegant and generic way problem of getting very big amount of data from WCF server. This is my resolution for that problem and it based on materialization of generic IEnumerable interface for both client and server site. On server site I try to prepare generic way for getting any kind of data from any kind of data source. Also in my solution I use small buffer for data, because I Continue ReadingForeach in WCF Generic Implementation (New)

PublisherConsumerCollection<T>

Hi, today I will show you a special concurrent collection created with Publisher->Consumer pattern. Below I will show you a C# 4.0 code with a small benchmark. Enjoy :). Benchmark output: And when you comment out 177 line with waiting in Add method: It is up to you how to change this example, but you can see that using Publisher->Customer pattern is in some case twice faster than very good .NET 4.0 ConcurrentDictionary<TKey,TValue>, :). Regards, P ;). Continue ReadingPublisherConsumerCollection<T>