Your source of geek knowledge

Participating in TransactionScopes and Async/Await Let’s get the money back!

In my last post we lost billions of dollars from a VIP customer. Let’s not do that again, shall we? In the meantime you should have bought a bigger wallet, I hope you did your homework as well. So the question is how can we improve the situation? Let do a quick recap what went wrong last time:

We were using async void to fire & forget the send operation inside the enlistment implementation. This allowed us to asynchronously dispatch the send operation without blocking the client code. The major drawback of this approach was that because of the nature of fire & forget we would not get any exceptions captured and “marshalled” back to the client. So in the case something goes wrong inside the send operation the whole operation would be lost without us getting notified.

We can address the same way unit testing frameworks are supporting async void methods. Continue reading

Participating in TransactionScopes and Async/Await Alone in the dark

In my last post I showed you how to enable asynchronous transaction flow in .NET 4.5.1 and how you can write an enlistment which participates in the transaction scope. But something went terribly wrong. I’m sure you already spotted it. Let us have a quick look at the test execution from my previous post.


The test execution time clearly shows that the red test took less than a second to process and then failed. How can that be when our simulated send operation asynchronously delays its execution for 1000 milliseconds and we are effectively doing three of those sends? Continue reading

Book review: Code Simplicity by Max Kanat-Alexander

Code SimplicityTarget audience: developers

Urs’ comment: A short, simple book about what makes software complex, how to prevent that and therefore keep software simple. This book contains rules and facts about software regarding code simplicity. The problem of the book is that either you probably know most of its content or you think that it doesn’t work anyway (I got this impression while reading through the reviews on Amazon). Anyway, I think it is worth the time and helps to reflect on one’s own way of coding.

ISBN: 978-1-449-31389-0

Book review: Lean Architecture – for Agile Software Development by Jamey O. Coplien & Gertrud Bjornvig

lean architectureTarget audience: software architects

Urs’ comment: This book claims a lot, and delivers little. There are several good tips in this book, but overall I simply don’t like it. I don’t like the “tone” it is written in.
There are only few books about Agile and Lean software architecture, therefore I cannot really give a better alternative covering the same topic.
Ultimately,  that means you have to read it in case you are in any kind responsible for the architecture in an Lean/Agile set-up.

ISBN: 978-0-470-68420-7

Book review: This is Lean – Resolving the efficiency paradox by Niklas Modig & Pär Ahlström

this is leanTarget audience: anybody interested in lean

Urs’ comment: I heard and read a lot about lean during the last years. I heard about eliminating waste, Toyota, lean architecture and much more. This book helped me understand what lean actually is, and what it’s not. I like the samples and stories and the clear distinction of values, principles, methods, tools and activities.
It’s a quick and nice read, so there is no excuse to not read it – in case you want to use the term lean yourself.

ISBN: 978-91-980393-0-6

Is MacOs dead? Apple wants us to migrate to Windows 8.1

This Christmas I upgraded my IT infrastructure to the latest and greatest. I bought a new Mac Book Pro Retina 15 inch with 1 TB SDD, 16 GB Ram, NVidia graphics card and latest i7 processor available for Mac Books. This is the detailed spec I currently own:

  • 1TB PCIe-based Flash Storage
  • 16GB 1600MHz DDR3L SDRAM
  • 8GHz Quad-core Intel Core i7, Turbo Boost up to 4.0GHz
  • NVIDIA GeForce GT 750M with 2GB of GDDR5 memory

The performance and hardware you get for the price is really awesome. Then I started looking around for good external screens for both reading online content and developing software. My thought was to go for 4k screens. Before started evaluating the screens I looked for specs whether the Mac Book could handle 4k resolution and also multiple screens. My quick research showed that connecting 4k screens is possible although I overlooked one small but important detail which I’ll explain later. First I ordered two Samsung LU28D590DS screens. But a good friend of mine told me that the stand of these screens is so terrible that the screen trembles heavily even when you type. So I cancelled my order. After comparing the prices of the remaining 4k screens I finally settled on the Asus PB287Q. It is “only” a TN-Panel but has a very good price for its capabilities.

When I got the screens I started MacOS and connected both 4k screens over mini DisplayPort (on the thunderbolt connector) to my Mac Book. Before I did that I enabled DisplayPort 1.2 support which is required to support 4k with 60Hz. Then the shock started. Only one screen was working at a time. First I thought there is something wrong with the screens. I switched them off and on, exchanged cables and more. Still only one worked at a time. So I googled again the specs and found the missing piece in the puzzle in a support article. Basically they are saying in order to have 4k with 60Hz you need Multi Stream Support enable on the screen which I did and then only one 4 k screen is supported with 60Hz.

See more on Know Your Meme

Let me think again. I have Thunderbolt2 with approximately 20 Gbps bandwidth. DisplayPort 1.2 needs somewhere around 17 Gbps so this should technically be plenty. I have two Thunderbolt2 ports in my Mac Book and still Mac OS refuses to turn on my additional 4k screen. I couldn’t believe that. After some more research and reading the discussion threads here and here I found out that it is really a driver and not a hardware restriction.

So how can I get around this driver restriction? Nothing simpler than that. You prepare a bootcamp partition, install Windows 8.1, start into the Windows 8.1 on the bootcamp partition, connect both 4k screen to each Thunderbolt2 port, Windows 8.1 detects those display and runs them with 60Hz in full 4k resolution! Here the proof:

Foto 05.01.15 20 14 59

Dear Apple: Are you silently saying that MacOs is dead and Windows 8.1 is the future platform for Mac Books?

Machine.Specifications.Runner.Resharper 1.0.0 released

Thanks to Matt Ellis and some bug hunting of me I can proudly say that we have released Resharper 9 integration for Machine.Specifications. You can now install the plugin by using the provided extension manager in Resharper 9.


For those who are using Resharper versions older than 9 I pushed an update for the plugin for Resharper 8.2. It resolves an issues when you switch from Debug to Release mode or vice versa while having a unit test session open. If you did, you actually had to restart Visual Studio so that the Resharper plugin picked up the correct output path location of the specs assembly. Older Resharper versions are no longer supported as well as the installation via batch files. If you find anyting feel free to open issues on the github repository.


Participating in TransactionScopes and Async/Await Going deep into the abyss

In my last post I showed you the TransactionScope class and how you can write your own enlistments to participate in transactions. The code we wrote was all synchronous. This time we are going deep into the abyss and change our code sample to a completely asynchronous API. Let’s explore how the code could look like: Continue reading