Archive for the 'Uncategorized' Category
disruptor-net
If you are concerned by performance, you will probably have heard about LMAX and their disruptor pattern. If not you should have a look to this video and to this white paper first.
LMAX team released the concurrency framework at the heart of their system about one month ago and I decided to port it to .NET.
The source code, unit tests and performance tests have all been ported to .NET and current trunk is in sync with latest Javav version. Performance tests show equivalent level of performance for Java and .NET versions.
If you are interested you can have a look to the disruptor-net project on google code and participate to the discussions on the .NET discussion group or the Java discussion group
Comments are off for this postNirvana Part II : Queues
Queue is the second main construct available in Nirvana to distribute messages between producer and consumer applications.
Unlike channels, queues dispatch events to one and only one consumer and reads are destructive: when an event in send to a subscriber, the event is automatically removed (popped) from the queue. It is as well possible for entitled consumers to browse the queue content using peek operation.
Implementing load balancing using a queue
Queues are particularly useful to implement load balancing between applications: if multiple consumer are subscribed on the queue, events will be load balanced between subscriber using a round-robin algorithm. You will likely want to use a queue to load balance events between multiple active instances of an application.
Example:
This example describes a load balancing scenario between one producer and 2 consumers (C1 and C2):
- C1 is started first and subscribes to the queue
- the producer is then started and publishes event1 to the queue
- since there is only one subscriber on the queue the event is directly dispatched to C1 and the event is removed from the queue
- C2 is now started and subscribed to the queue
- the producer publishes event2
- this time there are two subscribers on the queue: the event is randomly dispatched to one of the consumers
- C2 is stopped (or C2 process fails)
- the producer publishes event3
- Nirvana has detected that the connection with C2 has been lost: C2 is no longer subscribed to the queue so the event is dispatched to C1
Queues attributes
You can refer to the previous post about channels, attributes for queues and channels are the same.
Note about queues
It is good to keep in mind that queues are more expensive for Nirvana than channels: destructive reads requires additional synchronization, especially in a clustered environment.
Comments are off for this postSaturday Morning, Setting up dev environment…

I woke up quite early this morning and set up my personal computer with my favorites toys :
- VS2008 with Resharper 4,
- Download Castle Windsor, log4net, TestDriven.net, GhostDoc, TeamCity VS2008 plugin, TeamCity tray
- TeamCity (i did not tried it before, how stupid I was…),
- set up a project on google code (SVN repository, wiki, etc)
- set up turtoiseSVN with the google repository,
- created a solution, a project and one unit test,
- commit,
- configure TeamCity to check-out my SVN project on google code, build the project and run the test,
- after a few minutes 1rst build succeded !
I’m very impressed by the quality of TeamCity. For those who don’t know, TeamCity is a build server developed by JetBrains (Resharper, IntelliJ and other GODies). I’ve already tried other products of this kind but this is by far the easier to use. It directly supports VS 2005/2008 solution files (.sln) and I just had to fill 2-3 forms to have a running environment. TC also supports NAnt, Ant, MSBuild and lots of other build tools.
No comments