Three different ways to raise events in C#

The Event model in C# finds its roots in the event programming model that is popular in asynchronous programming. The basic foundation behind this programming model is the idea of "publisher and subscribers." In this model, you have publishers who will do some logic and publish an "event." Publishers will then send out their event … Continue reading Three different ways to raise events in C#

How to remove a setup package with a known uninstall bug

Today was the 2nd time I managed to cause a machine at work to not be able to uninstall the project I've been working on. During installation tests I "accidentally" deleted part of the registry and resulting in not being able to uninstall the MSI (because it wasn't there) and not being able to install … Continue reading How to remove a setup package with a known uninstall bug

MSDN Magazine October 2008 – Features Parallelism

In case you haven't noticed yet the new issue of MSDN magazine is available online. This issue focuses on multi-threading and parallel programming and has very interesting articles on that topic. The content is great - especially for developers that are interested in learning how to make the switch from sequential to parallel (multi threaded) … Continue reading MSDN Magazine October 2008 – Features Parallelism

Why Atomic operations are not always thread safe

A question I saw on StackOverflow: Is accessing a bool field atomic in C#? In particular, do I need to put a lock around:class Foo{private bool _bar;//... in some function on any thread (or many threads)_bar = true;//... same for a readif (_bar) { ... }}This question was answered quickly by several users that quoted … Continue reading Why Atomic operations are not always thread safe

Three Fixes that helped me when windows failed to Install an update

I think that it happen to me at least once in each computer I own or worked on: While running Windows (or Microsoft) update I get an error claiming that the update could not be installed. This used to be a source of frustration for me. I needed to Google around and try solutions and … Continue reading Three Fixes that helped me when windows failed to Install an update